diff options
author | Cupertino Miranda <cmiranda@synopsys.com> | 2016-07-21 15:32:35 +0200 |
---|---|---|
committer | Cupertino Miranda <cmiranda@synopsys.com> | 2016-08-26 12:09:17 +0200 |
commit | 980aa3e6dfeb0f018915f65be4b2987667f31fe9 (patch) | |
tree | 148ba0cdbe9f1296b8d6dec12fb9eac8ab4edb86 /bfd | |
parent | 65b94e90977efe3235381708f5a3e0d541026d88 (diff) | |
download | binutils-gdb-980aa3e6dfeb0f018915f65be4b2987667f31fe9.tar.gz |
Dynamic TLS GOT entries would not be relocated.
Forgot to set should_relocate to TRUE in case of GOT and TLS relocations of
undefined symbols for shared libraries.
In dynamic libraries if symbol is not known the instruction relocation would
not be resolved to point to the respective .got entry.
A test was created to detect similar future mistakes.
bfd/ChangeLog:
Cupertino Miranda <cmiranda@synopsys.com>
* elf32-arc.c (elf_arc_relocate_section): Changed. Set should_relocate
to TRUE for GOT and TLS relocs.
ld/ChangeLog:
Cupertino Miranda <cmiranda@synopsys.com>
* ld/testsuite/ld-arc/tls_gd-01.s: Added a testcase for this patch.
* ld/testsuite/ld-arc/tls_gd-01.d: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-arc.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 169b8b5e270..3d4dc40a33f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-08-26 Cupertino Miranda <cmiranda@synopsys.com> + + * elf32-arc.c (elf_arc_relocate_section): Changed. Set should_relocate + to TRUE for GOT and TLS relocs. + 2016-08-26 Cupertino Miranda <cmiranda@synospsys.com> * elf32-arc.c (elf_arc_finish_dynamic_sections): Changed. diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 5ba170e7fa6..b726dab960d 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -1374,6 +1374,8 @@ elf_arc_relocate_section (bfd * output_bfd, if ((is_reloc_for_GOT (howto) || is_reloc_for_TLS (howto))) { + reloc_data.should_relocate = TRUE; + struct got_entry **list = get_got_entry_list_for_symbol (output_bfd, r_symndx, h); |