diff options
| author | matt <matt@NetBSD.org> | 1998-08-27 21:20:44 +0000 |
|---|---|---|
| committer | matt <matt@NetBSD.org> | 1998-08-27 21:20:44 +0000 |
| commit | c75dbabbf684808a2ca72200ee2b69d32523d8c3 (patch) | |
| tree | 9db95b7a76aa6ebf94574881c9ac13e2f4d0cd52 /gnu/usr.bin | |
| parent | 7e95972ed11e40d260ae1b7118fd33c98c1535a4 (diff) | |
only emit __PROCEDURE_LINKAGE_TABLE_ if generating shared library.
Diffstat (limited to 'gnu/usr.bin')
| -rw-r--r-- | gnu/usr.bin/ld/ld/ld.c | 10 | ||||
| -rw-r--r-- | gnu/usr.bin/ld/ld/symbol.c | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/gnu/usr.bin/ld/ld/ld.c b/gnu/usr.bin/ld/ld/ld.c index 3667264087a..adadb1d5303 100644 --- a/gnu/usr.bin/ld/ld/ld.c +++ b/gnu/usr.bin/ld/ld/ld.c @@ -1,4 +1,4 @@ -/* $NetBSD: ld.c,v 1.55 1998/08/26 14:37:41 matt Exp $ */ +/* $NetBSD: ld.c,v 1.56 1998/08/27 21:20:45 matt Exp $ */ /*- * This code is derived from software copyrighted by the Free Software @@ -1509,7 +1509,8 @@ enter_global_ref(lsp, name, entry) sp->flags |= GS_REFERENCED; - if (sp == dynamic_symbol || sp == got_symbol || sp == plt_symbol) { + if (sp == dynamic_symbol || sp == got_symbol + || (sp == plt_symbol && plt_symbol != NULL)) { if (type != (N_UNDF | N_EXT) && !(entry->flags & E_JUST_SYMS)) errx(1,"Linker reserved symbol %s defined as type %x ", name, type); @@ -1840,7 +1841,7 @@ printf("set_sect_start = %#x, set_sect_size = %#x\n", if (got_symbol->flags & GS_REFERENCED) global_sym_count++; - if (plt_symbol->flags & GS_REFERENCED) + if (plt_symbol != NULL && plt_symbol->flags & GS_REFERENCED) global_sym_count++; if (relocatable_output || building_shared_object) { @@ -1909,7 +1910,8 @@ digest_pass1() /* Already examined; must have been an alias */ continue; - if (sp == got_symbol || sp == dynamic_symbol || sp == plt_symbol) + if (sp == got_symbol || sp == dynamic_symbol + || (sp == plt_symbol && plt_symbol != NULL)) continue; for (lsp = sp->refs; lsp; lsp = lsp->next) { diff --git a/gnu/usr.bin/ld/ld/symbol.c b/gnu/usr.bin/ld/ld/symbol.c index 70635bce6e6..e37e7f75213 100644 --- a/gnu/usr.bin/ld/ld/symbol.c +++ b/gnu/usr.bin/ld/ld/symbol.c @@ -1,4 +1,4 @@ -/* $NetBSD: symbol.c,v 1.10 1998/08/26 14:39:47 matt Exp $ */ +/* $NetBSD: symbol.c,v 1.11 1998/08/27 21:20:44 matt Exp $ */ /* * - symbol table routines @@ -53,15 +53,17 @@ symtab_init(relocatable_output) dynamic_symbol = getsym(DYN_SYM); dynamic_symbol->defined = relocatable_output?N_UNDF:(N_DATA | N_EXT); - plt_symbol = getsym(PLT_SYM); - plt_symbol->defined = relocatable_output?N_UNDF:(N_DATA | N_EXT); - got_symbol = getsym(GOT_SYM); got_symbol->defined = N_DATA | N_EXT; if (relocatable_output) return; + if (link_mode & SHAREABLE) { + plt_symbol = getsym(PLT_SYM); + plt_symbol->defined = relocatable_output?N_UNDF:(N_DATA | N_EXT); + } + etext_symbol = getsym(ETEXT_SYM); edata_symbol = getsym(EDATA_SYM); end_symbol = getsym(END_SYM); |
