aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-or1k.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-or1k.c')
-rw-r--r--bfd/elf32-or1k.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
index d1d27f1..424a2d3 100644
--- a/bfd/elf32-or1k.c
+++ b/bfd/elf32-or1k.c
@@ -1301,6 +1301,15 @@ or1k_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);