public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [committed, PATCH] Always create dynsym section with dynamic sections
@ 2016-02-23  0:33 H.J. Lu
  2016-04-22 17:04 ` Faraz Shahbazker
  0 siblings, 1 reply; 23+ messages in thread
From: H.J. Lu @ 2016-02-23  0:33 UTC (permalink / raw)
  To: binutils

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;
-- 
2.5.0

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2016-04-26  2:08 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-23  0:33 [committed, PATCH] Always create dynsym section with dynamic sections H.J. Lu
2016-04-22 17:04 ` Faraz Shahbazker
2016-04-22 18:11   ` H.J. Lu
2016-04-22 18:56     ` Faraz Shahbazker
2016-04-22 19:29       ` H.J. Lu
2016-04-22 21:49         ` Faraz Shahbazker
2016-04-22 22:57           ` H.J. Lu
2016-04-22 23:09             ` Faraz Shahbazker
2016-04-22 23:24           ` H.J. Lu
2016-04-22 23:25             ` H.J. Lu
2016-04-23  1:38             ` Faraz Shahbazker
2016-04-23  2:05               ` H.J. Lu
2016-04-23  2:32                 ` Faraz Shahbazker
2016-04-23 12:27                   ` H.J. Lu
2016-04-23 15:25                     ` Faraz Shahbazker
2016-04-23 15:36                       ` H.J. Lu
2016-04-23 19:26                         ` Faraz Shahbazker
2016-04-24  1:43                           ` H.J. Lu
2016-04-25  2:18                             ` Faraz Shahbazker
2016-04-25 12:47                               ` H.J. Lu
2016-04-25 13:41                                 ` Alan Modra
2016-04-25 16:03                                   ` H.J. Lu
2016-04-26  2:08                                     ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).