aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-lm32.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-12-06 17:31:15 +1030
committerAlan Modra <amodra@gmail.com>2017-12-06 17:51:14 +1030
commit65281396861dfcfa993eb5af4769d6837104890d (patch)
tree832bc06983668123df1341c33570d26d3495a7e4 /bfd/elf32-lm32.c
parenta3cc9aad2e3de033462d64c8e028e1a3587c63e9 (diff)
downloadgdb-65281396861dfcfa993eb5af4769d6837104890d.zip
gdb-65281396861dfcfa993eb5af4769d6837104890d.tar.gz
gdb-65281396861dfcfa993eb5af4769d6837104890d.tar.bz2
Fix Common symbol override test fails
Fixes fails on SH and NDS32 introduced by dyn_reloc tidy. * elf32-lm32.c (lm32_elf_check_relocs): Skip non-ALLOC sections. * elf32-m32r.c (m32r_elf_check_relocs): Likewise. * elf32-nds32.c (nds32_elf_check_relocs): Likewise. * elf32-or1k.c (or1k_elf_check_relocs): Likewise. * elf32-sh.c (sh_elf_check_relocs): Likewise.
Diffstat (limited to 'bfd/elf32-lm32.c')
-rw-r--r--bfd/elf32-lm32.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c
index 3867542..17b188b 100644
--- a/bfd/elf32-lm32.c
+++ b/bfd/elf32-lm32.c
@@ -1165,6 +1165,15 @@ lm32_elf_check_relocs (bfd *abfd,
if (bfd_link_relocatable (info))
return TRUE;
+ /* Don't do anything special with non-loaded, non-alloced sections.
+ In particular, any relocs in such sections should not affect GOT
+ and PLT reference counting (ie. we don't allow them to create GOT
+ or PLT entries), there's no possibility or desire to optimize TLS
+ relocs, and there's not much point in propagating relocs to shared
+ libs that the dynamic linker won't relocate. */
+ if ((sec->flags & SEC_ALLOC) == 0)
+ return TRUE;
+
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym);