diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2019-10-03 19:11:50 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2019-10-04 10:54:16 +0100 |
commit | b627f56244cb2930c5891cfde03586987d46b5d2 (patch) | |
tree | bcf98c81badd1d49b135cd58671732a9589a8b9a /bfd | |
parent | 77c2dba3e843694fae090e237ccdf1b8f65b94e6 (diff) | |
download | gdb-b627f56244cb2930c5891cfde03586987d46b5d2.zip gdb-b627f56244cb2930c5891cfde03586987d46b5d2.tar.gz gdb-b627f56244cb2930c5891cfde03586987d46b5d2.tar.bz2 |
[PR ld/25062] arm: sign extend the addend of R_ARM_TLS_GOTDESC
On 64-bit host the 32-bit addend was loaded without sign extension into
an unsigned long.
bfd/ChangeLog:
PR ld/25062
* elf32-arm.c (elf32_arm_final_link_relocate): Sign extend data.
ld/ChangeLog:
PR ld/25062
* testsuite/ld-arm/arm-elf.exp: Update.
* testsuite/ld-arm/tls-gdesc-neg.d: New test.
* testsuite/ld-arm/tls-gdesc-neg.s: New test.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fcb645b..85dc6b2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2019-10-04 Szabolcs Nagy <szabolcs.nagy@arm.com> + + PR ld/25062 + * elf32-arm.c (elf32_arm_final_link_relocate): Sign extend data. + 2019-09-30 Nick Alcock <nick.alcock@oracle.com> * elf-bfd.h (bfd_section_is_ctf): New inline function. diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index bb53e03..d52c046 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -12027,9 +12027,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, unsigned long data, insn; unsigned thumb; - data = bfd_get_32 (input_bfd, hit_data); + data = bfd_get_signed_32 (input_bfd, hit_data); thumb = data & 1; - data &= ~1u; + data &= ~1ul; if (thumb) { |