From df538463687d768b6ee8247ff4412b78850e7404 Mon Sep 17 00:00:00 2001 From: Robert de Bath Date: Sun, 17 Feb 2002 23:02:29 +0100 Subject: Import Dev86src-0.16.2.tar.gz --- ld/include/fcntl.h | 2 -- ld/typeconv.c | 4 ++-- ld/writex86.c | 9 ++++++--- 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 ld/include/fcntl.h (limited to 'ld') diff --git a/ld/include/fcntl.h b/ld/include/fcntl.h deleted file mode 100644 index 8c1ec8b..0000000 --- a/ld/include/fcntl.h +++ /dev/null @@ -1,2 +0,0 @@ -#define O_RDONLY 0 -#define O_WRONLY 1 diff --git a/ld/typeconv.c b/ld/typeconv.c index 708d92b..d8c0c89 100644 --- a/ld/typeconv.c +++ b/ld/typeconv.c @@ -15,8 +15,8 @@ void xxerr(x) char * x; { write(2, x, strlen(x)); } static int no_swap = 1; -static long_off[4] = {0,1,2,3}; -static int_off[2] = {0,1}; +static int long_off[4] = {0,1,2,3}; +static int int_off[2] = {0,1}; PUBLIC bool_pt typeconv_init(big_endian, long_big_endian) bool_pt big_endian; diff --git a/ld/writex86.c b/ld/writex86.c index 86c3157..70ecdde 100644 --- a/ld/writex86.c +++ b/ld/writex86.c @@ -146,6 +146,7 @@ bool_pt argxsym; curseg = 0; /* text seg, s.b. variable */ symres("__etext"); symres("__segoff"); + symres("__heap_top"); /* calculate segment and common sizes (sum over loaded modules) */ /* use zero init of segsz[] */ @@ -315,6 +316,11 @@ bool_pt argxsym; fatalerror("data segment too large for 16bit"); } + if( heap_top_value < 0x100 || endoffset > heap_top_value-0x100) + heap_top_value = endoffset + 0x8000; + if( heap_top_value > 0x10000 && !bits32 ) heap_top_value = 0x10000; + setsym("__heap_top", (bin_off_t)heap_top_value); + openout(outfilename); writeheader(); for (modptr = modfirst; modptr != NUL_PTR; modptr = modptr->modnext) @@ -614,9 +620,6 @@ PRIVATE void writeheader() if (uzp) offtocn((char *) &header.a_entry, page_size(), sizeof header.a_entry); - if( heap_top_value < 0x100 || endoffset > heap_top_value-0x100) - heap_top_value = endoffset + 0x8000; - if( heap_top_value > 0x10000 && !bits32 ) heap_top_value = 0x10000; offtocn((char *) &header.a_total, (bin_off_t) heap_top_value, sizeof header.a_total); -- cgit v1.2.1