This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed 2.28 1/2] ELF/BFD: Limit `_bfd_elf_link_renumber_dynsyms' call in section GC

Consistently call `_bfd_elf_link_renumber_dynsyms' only if linking a 
dynamic binary, complementing code in `bfd_elf_size_dynsym_hash_dynstr' 
and commit ccabcbe51e85 ("New attempt at fixing MIPS --gc-sections et 
al."), <>.

	* elflink.c (elf_gc_sweep): Only call
	`_bfd_elf_link_renumber_dynsyms' if dynamic sections have been 

(backported from commit c46cec3a8cfe02fbe0f6c67ba53abc5369c5c659)
 No regressions across the usual targets.  Committed to 2.28.


Index: binutils/bfd/elflink.c
--- binutils.orig/bfd/elflink.c	2017-04-26 13:50:04.000000000 +0100
+++ binutils/bfd/elflink.c	2017-04-26 13:56:16.393714349 +0100
@@ -12983,7 +12983,8 @@ elf_gc_sweep (bfd *abfd, struct bfd_link
   elf_link_hash_traverse (elf_hash_table (info), elf_gc_sweep_symbol,
-  _bfd_elf_link_renumber_dynsyms (abfd, info, &section_sym_count);
+  if (elf_hash_table (info)->dynamic_sections_created)
+    _bfd_elf_link_renumber_dynsyms (abfd, info, &section_sym_count);
   return TRUE;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]