[committed, PATCH] Always create dynsym section with dynamic sections
Faraz Shahbazker
faraz.shahbazker@imgtec.com
Fri Apr 22 17:04:00 GMT 2016
More information about the Binutils mailing list
Fri Apr 22 17:04:00 GMT 2016
- Previous message (by thread): [committed] MIPS/GAS: Fix an ISA override not lifting ABI restrictions
- Next message (by thread): [committed, PATCH] Always create dynsym section with dynamic sections
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, This is breaking a gc-sections test-case for MIPS. MIPS at least, uses the elf_link_hash_table to track symbols even for static executables. The renumbering violates assertions about how MIPS expects the table to look. We could change the assert conditions, but I think thank since the NULL entry originated when the table was initialized, it should exist just the same after renumbering. If there is an additional case (dynamic_sections_created), it should be OR'd to the pre-existing condition. Thanks, Faraz Shahbazker On 02/22/2016 04:32 PM, H.J. Lu wrote: > We should always create the dynsym section, even if it is empty, with > dynamic sections. > > * elflink.c (_bfd_elf_link_renumber_dynsyms): Always create the > dynsym section, even if it is empty, with dynamic sections. > --- > bfd/ChangeLog | 5 +++++ > bfd/elflink.c | 6 +++--- > 2 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/bfd/ChangeLog b/bfd/ChangeLog > index dd1a308..1e0f6a1 100644 > --- a/bfd/ChangeLog > +++ b/bfd/ChangeLog > @@ -1,5 +1,10 @@ > 2016-02-22 H.J. Lu <hongjiu.lu@intel.com> > > + * elflink.c (_bfd_elf_link_renumber_dynsyms): Always create the > + dynsym section, even if it is empty, with dynamic sections. > + > +2016-02-22 H.J. Lu <hongjiu.lu@intel.com> > + > * syms.c: Remove BSF_COMMON from comments. > * bfd-in2.h: Regenerated. > > diff --git a/bfd/elflink.c b/bfd/elflink.c > index c7672ed..89a6dea 100644 > --- a/bfd/elflink.c > +++ b/bfd/elflink.c > @@ -875,9 +875,9 @@ _bfd_elf_link_renumber_dynsyms (bfd *output_bfd, > &dynsymcount); > > /* There is an unused NULL entry at the head of the table which > - we must account for in our count. Unless there weren't any > - symbols, which means we'll have no table at all. */ > - if (dynsymcount != 0) > + we must account for in our count. We always create the dynsym > + section, even if it is empty, with dynamic sections. */ > + if (elf_hash_table (info)->dynamic_sections_created) > ++dynsymcount; > > elf_hash_table (info)->dynsymcount = dynsymcount; >
- Previous message (by thread): [committed] MIPS/GAS: Fix an ISA override not lifting ABI restrictions
- Next message (by thread): [committed, PATCH] Always create dynsym section with dynamic sections
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list