diff options
| author | pk <pk@NetBSD.org> | 1994-04-22 07:55:19 +0000 |
|---|---|---|
| committer | pk <pk@NetBSD.org> | 1994-04-22 07:55:19 +0000 |
| commit | b1392e7c170fa2d248ccd2bb461292d126ca9906 (patch) | |
| tree | 96ba2d7f10e06cb811dbbd477483dde5fddc19cc /gnu/usr.bin | |
| parent | d4476c6ffc48b2210f68a36c9696b3bd85a17384 (diff) | |
Properly round the allocated set vector space; reduces by one the number
of ways in which C++ programs will dump core.
Diffstat (limited to 'gnu/usr.bin')
| -rw-r--r-- | gnu/usr.bin/ld/ld.c | 24 | ||||
| -rw-r--r-- | gnu/usr.bin/ld/ld/ld.c | 24 |
2 files changed, 44 insertions, 4 deletions
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c index a2926222048..db1497ed7b3 100644 --- a/gnu/usr.bin/ld/ld.c +++ b/gnu/usr.bin/ld/ld.c @@ -32,7 +32,7 @@ static char sccsid[] = "@(#)ld.c 6.10 (Berkeley) 5/22/91"; Set, indirect, and warning symbol features added by Randy Smith. */ /* - * $Id: ld.c,v 1.24 1994/04/15 10:05:39 pk Exp $ + * $Id: ld.c,v 1.25 1994/04/22 07:55:19 pk Exp $ */ /* Define how to initialize system-dependent header fields. */ @@ -250,6 +250,7 @@ static void write_rel __P((void)); static void write_syms __P((void)); static void assign_symbolnums __P((struct file_entry *, int *)); static void myfatal __P((void)); +static int parse __P((char *, char *, char *)); int @@ -1574,7 +1575,7 @@ digest_symbols () data_start = rrs_data_start + rrs_data_size; if (!relocatable_output) { set_sect_start = rrs_data_start + data_size; - data_size += set_sect_size; + data_size += MALIGN(set_sect_size); } bss_start = rrs_data_start + data_size; @@ -1585,6 +1586,8 @@ printf("datastart = %#x, datasize = %#x, rrs_data_start %#x, rrs_data_size %#x\n data_start, data_size, rrs_data_start, rrs_data_size); printf("bssstart = %#x, bsssize = %#x\n", bss_start, bss_size); +printf("set_sect_start = %#x, set_sect_size = %#x\n", + set_sect_start, set_sect_size); #endif /* Compute start addresses of each file's sections and symbols. */ @@ -3386,6 +3389,23 @@ write_file_syms(entry, syms_written_addr) } /* + * Parse the string ARG using scanf format FORMAT, and return the result. + * If it does not parse, report fatal error + * generating the error message using format string ERROR and ARG as arg. + */ + +static int +parse(arg, format, error) + char *arg, *format, *error; +{ + int x; + + if (1 != sscanf(arg, format, &x)) + fatal(error, arg); + return x; +} + +/* * Output COUNT*ELTSIZE bytes of data at BUF to the descriptor DESC. */ void diff --git a/gnu/usr.bin/ld/ld/ld.c b/gnu/usr.bin/ld/ld/ld.c index a2926222048..db1497ed7b3 100644 --- a/gnu/usr.bin/ld/ld/ld.c +++ b/gnu/usr.bin/ld/ld/ld.c @@ -32,7 +32,7 @@ static char sccsid[] = "@(#)ld.c 6.10 (Berkeley) 5/22/91"; Set, indirect, and warning symbol features added by Randy Smith. */ /* - * $Id: ld.c,v 1.24 1994/04/15 10:05:39 pk Exp $ + * $Id: ld.c,v 1.25 1994/04/22 07:55:19 pk Exp $ */ /* Define how to initialize system-dependent header fields. */ @@ -250,6 +250,7 @@ static void write_rel __P((void)); static void write_syms __P((void)); static void assign_symbolnums __P((struct file_entry *, int *)); static void myfatal __P((void)); +static int parse __P((char *, char *, char *)); int @@ -1574,7 +1575,7 @@ digest_symbols () data_start = rrs_data_start + rrs_data_size; if (!relocatable_output) { set_sect_start = rrs_data_start + data_size; - data_size += set_sect_size; + data_size += MALIGN(set_sect_size); } bss_start = rrs_data_start + data_size; @@ -1585,6 +1586,8 @@ printf("datastart = %#x, datasize = %#x, rrs_data_start %#x, rrs_data_size %#x\n data_start, data_size, rrs_data_start, rrs_data_size); printf("bssstart = %#x, bsssize = %#x\n", bss_start, bss_size); +printf("set_sect_start = %#x, set_sect_size = %#x\n", + set_sect_start, set_sect_size); #endif /* Compute start addresses of each file's sections and symbols. */ @@ -3386,6 +3389,23 @@ write_file_syms(entry, syms_written_addr) } /* + * Parse the string ARG using scanf format FORMAT, and return the result. + * If it does not parse, report fatal error + * generating the error message using format string ERROR and ARG as arg. + */ + +static int +parse(arg, format, error) + char *arg, *format, *error; +{ + int x; + + if (1 != sscanf(arg, format, &x)) + fatal(error, arg); + return x; +} + +/* * Output COUNT*ELTSIZE bytes of data at BUF to the descriptor DESC. */ void |
