aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-aarch64.c
diff options
context:
space:
mode:
authorYufeng Zhang <yufeng.zhang@arm.com>2012-10-16 16:36:50 +0000
committerYufeng Zhang <yufeng.zhang@arm.com>2012-10-16 16:36:50 +0000
commitbb3f9ed8ba3cfb9a271b84cc8f1d79878fb15e78 (patch)
treeede0cfb122e89842a33560fc1e0c15b5c34703c8 /bfd/elf64-aarch64.c
parent448835468fbad10d63450d25b9c7cf929fcde842 (diff)
downloadgdb-bb3f9ed8ba3cfb9a271b84cc8f1d79878fb15e78.zip
gdb-bb3f9ed8ba3cfb9a271b84cc8f1d79878fb15e78.tar.gz
gdb-bb3f9ed8ba3cfb9a271b84cc8f1d79878fb15e78.tar.bz2
Fixed AArch64 TLS relocation resolution.
bfd/ * elf64-aarch64.c (elf64_aarch64_tls_howto_table): Fix shift value for R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, R_AARCH64_TLSLE_MOVW_TPREL_G2, R_AARCH64_TLSLE_MOVW_TPREL_G1, R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, R_AARCH64_TLSLE_ADD_TPREL_HI12. (elf64_aarch64_tlsdesc_howto_table): Fix shift value for R_AARCH64_TLSDESC_LD64_PREL19 and R_AARCH64_TLSDESC_OFF_G1. (elf64_aarch64_final_link_relocate): Add signed_addend when resolving AARCH64_TLSLE_*_TPREL_* relocations. ld/testsuite/ * ld-aarch64/tlsle-symbol-offset.s: New file. * ld-aarch64/tlsle-symbol-offset.d: New file. * ld-aarch64/aarch64-elf.exp: Add tlsle-symbol-offset test.
Diffstat (limited to 'bfd/elf64-aarch64.c')
-rw-r--r--bfd/elf64-aarch64.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/bfd/elf64-aarch64.c b/bfd/elf64-aarch64.c
index 0607b3a..423fb9b 100644
--- a/bfd/elf64-aarch64.c
+++ b/bfd/elf64-aarch64.c
@@ -1076,7 +1076,7 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] =
FALSE), /* pcrel_offset */
HOWTO (R_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* type */
- 0, /* rightshift */
+ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
21, /* bitsize */
FALSE, /* pc_relative */
@@ -1090,7 +1090,7 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] =
FALSE), /* pcrel_offset */
HOWTO (R_AARCH64_TLSLE_MOVW_TPREL_G2, /* type */
- 8, /* rightshift */
+ 32, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
FALSE, /* pc_relative */
@@ -1104,7 +1104,7 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] =
FALSE), /* pcrel_offset */
HOWTO (R_AARCH64_TLSLE_MOVW_TPREL_G1, /* type */
- 4, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
FALSE, /* pc_relative */
@@ -1118,7 +1118,7 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] =
FALSE), /* pcrel_offset */
HOWTO (R_AARCH64_TLSLE_MOVW_TPREL_G1_NC, /* type */
- 4, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
FALSE, /* pc_relative */
@@ -1160,7 +1160,7 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] =
FALSE), /* pcrel_offset */
HOWTO (R_AARCH64_TLSLE_ADD_TPREL_HI12, /* type */
- 3, /* rightshift */
+ 12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
FALSE, /* pc_relative */
@@ -1205,7 +1205,7 @@ static reloc_howto_type elf64_aarch64_tls_howto_table[] =
static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] =
{
HOWTO (R_AARCH64_TLSDESC_LD64_PREL19, /* type */
- 0, /* rightshift */
+ 2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
21, /* bitsize */
TRUE, /* pc_relative */
@@ -1279,7 +1279,7 @@ static reloc_howto_type elf64_aarch64_tlsdesc_howto_table[] =
FALSE), /* pcrel_offset */
HOWTO (R_AARCH64_TLSDESC_OFF_G1, /* type */
- 4, /* rightshift */
+ 16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
FALSE, /* pc_relative */
@@ -4054,7 +4054,7 @@ elf64_aarch64_final_link_relocate (reloc_howto_type *howto,
case R_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
case R_AARCH64_TLSLE_MOVW_TPREL_G2:
value = aarch64_resolve_relocation (r_type, place, value,
- - tpoff_base (info), weak_undef_p);
+ signed_addend - tpoff_base (info), weak_undef_p);
*unresolved_reloc_p = FALSE;
break;