aboutsummaryrefslogtreecommitdiff
path: root/bfd/ChangeLog
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@mips.com>2018-07-11 17:44:45 +0100
committerMaciej W. Rozycki <macro@mips.com>2018-07-11 17:44:45 +0100
commit1cb83cac9a8974bdb12aac90018ad1165ba86274 (patch)
tree4f7e81df67ab99004599f21cddc7b57b8de736ea /bfd/ChangeLog
parent9143e72c6d4ddefbcb41c0f6361ad140354145ef (diff)
downloadgdb-1cb83cac9a8974bdb12aac90018ad1165ba86274.zip
gdb-1cb83cac9a8974bdb12aac90018ad1165ba86274.tar.gz
gdb-1cb83cac9a8974bdb12aac90018ad1165ba86274.tar.bz2
MIPS/BFD: Fix TLS relocation resolution for regular executables
Correct an issue with commit 0f20cc3522e7 ("TLS support for MIPS"), <https://sourceware.org/ml/binutils/2005-02/msg00607.html>, where a condition used to determine whether to use a dynamic symbol for GD, LD and IE TLS dynamic relocations against a symbol that has been defined locally has been incorrectly reversed. It's executables rather than dynamic shared objects where no symbol is required, because such symbols cannot be preempted and therefore their values (thread pointer offsets) are fixed at the static link time as is the associated module ID of the main executable, so the original condition should have been `shared' instead of `!shared'. This wrong condition was then later converted from `!shared' to `!bfd_link_pic', with commit 0e1862bb401f ("Add output_type to bfd_link_info"). Use the correct `bfd_link_dll' condition then, and adjust code for the dynamic symbol index possibly being -1 as with symbols that have been forced local, removing unnecessary dynamic relocations from dynamic regular executables. PIE executables are unaffected as the existing condition excluded them by chance due to the conversion mentioned above. Adjust test cases accordingly. bfd/ * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather than `!bfd_link_pic' in determining the dynamic symbol index. Avoid the index of -1. (mips_elf_initialize_tls_slots): Likewise. Flatten code by moving `dyn' to the beginning of the function block. ld/ * testsuite/ld-mips-elf/tlsdyn-o32.d: Update test for dynamic relocation removal. * testsuite/ld-mips-elf/tlsdyn-o32.got: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-1.d: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-1.got: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-2.d: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-2.got: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-3.d: Likewise. * testsuite/ld-mips-elf/tlsdyn-o32-3.got: Likewise.
Diffstat (limited to 'bfd/ChangeLog')
-rw-r--r--bfd/ChangeLog8
1 files changed, 8 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 402cdc4..d4e2c21 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,4 +1,12 @@
2018-07-11 Maciej W. Rozycki <macro@mips.com>
+
+ * elfxx-mips.c (mips_tls_got_relocs): Use `bfd_link_dll' rather
+ than `!bfd_link_pic' in determining the dynamic symbol index.
+ Avoid the index of -1.
+ (mips_elf_initialize_tls_slots): Likewise. Flatten code by
+ moving `dyn' to the beginning of the function block.
+
+2018-07-11 Maciej W. Rozycki <macro@mips.com>
Rich Felker <bugdal@aerifal.cx>
PR ld/22570