aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-04-19 11:19:35 +0930
committerAlan Modra <amodra@gmail.com>2018-04-20 22:58:28 +0930
commit4352556b36ab4f1c6f81a0ac3daf4619a419558d (patch)
treea305d1cdea77d3a14b25c908c94656c057ec6648 /gas/config
parent1a1de166f4e18227760b42301e3b615d71a62dc8 (diff)
downloadgdb-4352556b36ab4f1c6f81a0ac3daf4619a419558d.zip
gdb-4352556b36ab4f1c6f81a0ac3daf4619a419558d.tar.gz
gdb-4352556b36ab4f1c6f81a0ac3daf4619a419558d.tar.bz2
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.
Diffstat (limited to 'gas/config')
0 files changed, 0 insertions, 0 deletions