summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--distrib/common/rdsetroot.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/distrib/common/rdsetroot.c b/distrib/common/rdsetroot.c
index 33c6fdbc268..97169396184 100644
--- a/distrib/common/rdsetroot.c
+++ b/distrib/common/rdsetroot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rdsetroot.c,v 1.1 1997/04/20 23:38:17 downsj Exp $ */
+/* $OpenBSD: rdsetroot.c,v 1.2 1997/05/16 19:17:51 niklas Exp $ */
/* $NetBSD: rdsetroot.c,v 1.2 1995/10/13 16:38:39 gwr Exp $ */
/*
@@ -120,6 +120,14 @@ main(argc,argv)
* The file offset needs to be page aligned.
*/
data_off = N_DATOFF(head);
+
+ /*
+ * XXX it seems that our ld has a bug when generating NMAGIC files.
+ * the data segment ends up one page too far into the file.
+ */
+ if (N_GETMAGIC(head) == NMAGIC)
+ data_off += __LDPGSZ;
+
data_len = head.a_data;
/* align... */
data_pgoff = N_PAGSIZ(head) - 1;