• Alan Modra's avatar
    Hide dynamic symbols in discarded sections · ae0e76dc
    Alan Modra authored
    This is a followup to git commit 97196564 "Strip global symbol
    defined in discarded section".  If a symbol defined in a discarded
    section was dynamic, that patch left .dynsym with holes (ie. all zero
    entries).  For example, the following from libstdc++.so:
    
    Symbol table '.dynsym' contains 6090 entries:
       Num:    Value          Size Type    Bind   Vis      Ndx Name
         0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
         1: 00000000000a74e0     0 SECTION LOCAL  DEFAULT   10
         2: 0000000000264180     0 SECTION LOCAL  DEFAULT   17
         3: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _ITM_addUserCommitAction
         4: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _ITM_memcpyRtWn
         5: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
    readelf: Warning: local symbol 5 found at index >= .dynsym's sh_info value of 3
         6: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
    readelf: Warning: local symbol 6 found at index >= .dynsym's sh_info value of 3
    [snip]
    
    This patch removes the symbols from .dynsym too.
    
    	PR 17550
    	* elflink.c (_bfd_elf_fix_symbol_flags): Hide dynamic symbols
    	in discarded sections.
    
    (cherry picked from commit af0bfb9c4283ce80fe37ad6360d12cae8ec38696)
    ae0e76dc
Name
Last commit
Last update
bfd Loading commit data...
binutils Loading commit data...
config Loading commit data...
cpu Loading commit data...
elfcpp Loading commit data...
etc Loading commit data...
gas Loading commit data...
gdb Loading commit data...
gold Loading commit data...
gprof Loading commit data...
include Loading commit data...
intl Loading commit data...
ld Loading commit data...
libdecnumber Loading commit data...
libiberty Loading commit data...
opcodes Loading commit data...
readline Loading commit data...
sim Loading commit data...
texinfo Loading commit data...
zlib Loading commit data...
.cvsignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
COPYING Loading commit data...
COPYING.LIB Loading commit data...
COPYING.LIBGLOSS Loading commit data...
COPYING.NEWLIB Loading commit data...
COPYING3 Loading commit data...
COPYING3.LIB Loading commit data...
ChangeLog Loading commit data...
MAINTAINERS Loading commit data...
Makefile.def Loading commit data...
Makefile.in Loading commit data...
Makefile.tpl Loading commit data...
README Loading commit data...
README-maintainer-mode Loading commit data...
ar-lib Loading commit data...
compile Loading commit data...
config-ml.in Loading commit data...
config.guess Loading commit data...
config.rpath Loading commit data...
config.sub Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...
depcomp Loading commit data...
djunpack.bat Loading commit data...
install-sh Loading commit data...
libtool.m4 Loading commit data...
ltgcc.m4 Loading commit data...
ltmain.sh Loading commit data...
ltoptions.m4 Loading commit data...
ltsugar.m4 Loading commit data...
ltversion.m4 Loading commit data...
lt~obsolete.m4 Loading commit data...
makefile.vms Loading commit data...
missing Loading commit data...
mkdep Loading commit data...
mkinstalldirs Loading commit data...
move-if-change Loading commit data...
setup.com Loading commit data...
src-release.sh Loading commit data...
symlink-tree Loading commit data...
test-driver Loading commit data...
ylwrap Loading commit data...