From: H.J. Lu Date: Tue, 23 Feb 2016 00:30:30 +0000 (-0800) Subject: Always create dynsym section with dynamic sections X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1a6e6083b69dcb695e175b5dc02342391da6ba22;p=binutils-gdb.git Always create dynsym section with dynamic sections 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. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index dd1a308890c..1e0f6a13de3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-02-22 H.J. Lu + + * 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 * syms.c: Remove BSF_COMMON from comments. diff --git a/bfd/elflink.c b/bfd/elflink.c index c7672edf8ab..89a6dea7614 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;