[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/22978] [2.30, 2.31 Regression] TLS local-dynamic incorrectly lin
From: |
cvs-commit at gcc dot gnu.org |
Subject: |
[Bug ld/22978] [2.30, 2.31 Regression] TLS local-dynamic incorrectly linked on hppa-linux |
Date: |
Fri, 20 Apr 2018 13:51:04 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22978
--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot
gnu.org> ---
The master branch has been updated by Alan Modra <address@hidden>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4352556b36ab4f1c6f81a0ac3daf4619a419558d
commit 4352556b36ab4f1c6f81a0ac3daf4619a419558d
Author: Alan Modra <address@hidden>
Date: Thu Apr 19 11:19:35 2018 +0930
PR22978, TLS local-dynamic incorrectly linked on hppa-linux
We were emitting dynamic relocs on the second word of a TLS GD GOT
entry pair (the dtprel offset), without the addend necessary when no
symbol is present on the dynamic reloc. Unfortunately the simple
solution of providing the proper addend doesn't work due to an hppa
glibc ld.so bug that ignores such addends. So instead optimize the
relocs. The dtprel offset is known at link time for locally defined
symbols (the only case where we'll end up with no symbol on a dynamic
reloc) so we can omit the dynamic reloc in that case.
Furthermore, we can omit a dynamic reloc on the first word of a TLS GD
GOT entry pair (the module id) if the symbol is local and we are
producing an executable. Similarly, a tprel reloc on a TLS IE GOT
entry is not needed for local symbols in an executable. So the
condition for TLS GOT relocs can become bfd_link_dll(info) rather than
bfd_link_pic(info) as needed for normal GOT relocs.
This all presumes hppa ld.so doesn't need to differentiate TLS GD GOT
pairs from TLS LD GOT pairs, which is currently true.
PR 22978
* elf32-hppa.c (got_relocs_needed): Add extra param to special
case both dtprel and tprel relocs.
(allocate_dynrelocs): Adjust conditions for got relocs.
(elf32_hppa_relocate_section): Likewise for local sym got relocs.
Emit dynamic relocs on TLS GOT entries for shared libraries,
not when pic. Omit dynamic reloc on dtprel entry when local,
and on tprel entry when local and executable.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/22978] [2.30, 2.31 Regression] TLS local-dynamic incorrectly linked on hppa-linux, amodra at gmail dot com, 2018/04/18
- [Bug ld/22978] [2.30, 2.31 Regression] TLS local-dynamic incorrectly linked on hppa-linux, amodra at gmail dot com, 2018/04/18
- [Bug ld/22978] [2.30, 2.31 Regression] TLS local-dynamic incorrectly linked on hppa-linux, amodra at gmail dot com, 2018/04/19
- [Bug ld/22978] [2.30, 2.31 Regression] TLS local-dynamic incorrectly linked on hppa-linux,
cvs-commit at gcc dot gnu.org <=
- [Bug ld/22978] [2.30, 2.31 Regression] TLS local-dynamic incorrectly linked on hppa-linux, amodra at gmail dot com, 2018/04/20