mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
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.
This commit is contained in:
parent
4c043bb29e
commit
55e214c197
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15374
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user