ld/ARM: Fix IFUNC and TLS descriptors in the same shared object
authorWill Newton <will.newton@linaro.org>
Mon, 16 Jun 2014 14:49:07 +0000 (15:49 +0100)
committerWill Newton <will.newton@linaro.org>
Mon, 16 Jun 2014 14:51:21 +0000 (15:51 +0100)
commit9f19ab6dfa13c3971423624d18f20d90ab70c9cc
tree6ad062f4a16eaff590078a0c2d11a9505a7e0ad1
parentd03de42190b3b55fb195340dde8e595714a35090
ld/ARM: Fix IFUNC and TLS descriptors in the same shared object

Combining TLS descriptors and GNU indirect functions in the same
object could lead to assertions or multiple dynamic relocations
for the same GOT slot. Fix the bookkeeping so this doesn't happen.

This allows building and make checking glibc with -mtls-dialect=gnu2.

bfd/ChangeLog:

2014-06-16  Will Newton  <will.newton@linaro.org>

* elf32-arm.c (elf32_arm_allocate_plt_entry): Increment
htab->next_tls_desc_index in the non-IPLT case.
Calculate GOT offset correctly for the non-IPLT case.
(allocate_dynrelocs_for_symbol): Don't increment
htab->next_tls_desc_index here.

ld/testsuite/ChangeLog:

2014-06-16  Will Newton  <will.newton@linaro.org>

* ld-arm/arm-elf.exp: Add ifunc-gdesc test.
* ld-arm/ifunc-gdesc.r: New file.
* ld-arm/ifunc-gdesc.s: Likewise.
* ld-arm/ifunc-gdesc.ver: Likewise.
bfd/ChangeLog
bfd/elf32-arm.c
ld/testsuite/ChangeLog
ld/testsuite/ld-arm/arm-elf.exp
ld/testsuite/ld-arm/ifunc-gdesc.r [new file with mode: 0644]
ld/testsuite/ld-arm/ifunc-gdesc.s [new file with mode: 0644]
ld/testsuite/ld-arm/ifunc-gdesc.ver [new file with mode: 0644]