diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-05-16 19:17:52 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-05-16 19:17:52 +0000 |
commit | d0457a07483ef9e1a3076bf7f2895314b3e2ef83 (patch) | |
tree | c372d98a945adeb35ceb43575327cb408268becb /distrib/common/rdsetroot.c | |
parent | a019761a9d1cef4c815819554ce12675287f597a (diff) |
Add kludge to move around what seems to be a bug in ld(1) when
creating NMAGIC files. However in this case it is bad to correct ld as that
will break compatibility with other tools that assume the "incorrect" output
Diffstat (limited to 'distrib/common/rdsetroot.c')
-rw-r--r-- | distrib/common/rdsetroot.c | 10 |
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; |