diff options
author | jdp <jdp@FreeBSD.org> | 1996-04-24 23:31:08 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1996-04-24 23:31:08 +0000 |
commit | 128b738939eb7cfc2a7b122b5e2fdcada9f3428f (patch) | |
tree | b19a2a58ec6e95757257282098eca30f1099a574 /gnu/usr.bin/ld/ld.c | |
parent | 43a1e330ac7867511e8793190eee58f5ffa26001 (diff) | |
download | FreeBSD-src-128b738939eb7cfc2a7b122b5e2fdcada9f3428f.zip FreeBSD-src-128b738939eb7cfc2a7b122b5e2fdcada9f3428f.tar.gz |
When a local symbol that would normally be eliminated by "-x" or
"-X" must survive, because of references from relocations, don't
qualify the symbol name with the name of the input file. This
saves some string space. It makes libc_pic.a about 2.4% smaller.
Adapted from a suggestion by Bruce Evans.
Diffstat (limited to 'gnu/usr.bin/ld/ld.c')
-rw-r--r-- | gnu/usr.bin/ld/ld.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c index cb59660..49384f2 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.30 1995/09/28 19:43:20 bde Exp $ + * $Id: ld.c,v 1.31 1995/10/24 06:47:57 ache Exp $ */ /* Define how to initialize system-dependent header fields. */ @@ -3593,6 +3593,17 @@ write_file_syms(entry, syms_written_addr) if (!(lsp->flags & LS_WRITE)) continue; + if (discard_locals == DISCARD_ALL || + discard_locals == DISCARD_L && lsp->flags & LS_L_SYMBOL) { + /* + * The user wants to discard this symbol, but it + * is referenced by a relocation. We can still + * save some file space by suppressing the unique + * renaming of the symbol. + */ + lsp->flags &= ~LS_RENAME; + } + if (p->n_un.n_strx == 0) name = NULL; else if (!(lsp->flags & LS_RENAME)) |