summaryrefslogtreecommitdiff
path: root/bfd/elfxx-aarch64.c
diff options
context:
space:
mode:
authorRenlin Li <renlin.li@arm.com>2018-01-18 12:17:55 +0000
committerRenlin Li <renlin.li@arm.com>2018-01-24 16:20:05 +0000
commit1daf502a16e052b55a28bd52b4fde185ccc3b27b (patch)
tree2c8c92caab8fac1ff5f3f486a915994ed2a7b336 /bfd/elfxx-aarch64.c
parent322474019df79a1305e83ff7620a72f31a5c7b55 (diff)
downloadbinutils-gdb-1daf502a16e052b55a28bd52b4fde185ccc3b27b.tar.gz
[LD][AARCH64]Add group relocations to create PC-relative offset.
This is a patch to add linker support for group relocations to create a 16, 32, 48, or 64 bit PC-relative offset inline. The following relocations are added along with the test cases: BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3. bfd/ 2018-01-24 Renlin Li <renlin.li@arm.com> * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3. * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise. (_bfd_aarch64_elf_resolve_relocation): Likewise. ld/ 2018-01-24 Renlin Li <renlin.li@arm.com> * testsuite/ld-aarch64/aarch64-elf.exp: Run new testes. * testsuite/ld-aarch64/emit-relocs-287.s: Fix test case. * testsuite/ld-aarch64/emit-relocs-287.d: Fix expected output. * testsuite/ld-aarch64/emit-relocs-287-overflow.s: New. * testsuite/ld-aarch64/emit-relocs-287-overflow.d: New. * testsuite/ld-aarch64/emit-relocs-288.d: New. * testsuite/ld-aarch64/emit-relocs-288.s: New. * testsuite/ld-aarch64/emit-relocs-289.d: New. * testsuite/ld-aarch64/emit-relocs-289.s: New. * testsuite/ld-aarch64/emit-relocs-289-overflow.s: New. * testsuite/ld-aarch64/emit-relocs-289-overflow.d: New. * testsuite/ld-aarch64/emit-relocs-290.d: New. * testsuite/ld-aarch64/emit-relocs-290.s: New. * testsuite/ld-aarch64/emit-relocs-291.d: New. * testsuite/ld-aarch64/emit-relocs-291.s: New. * testsuite/ld-aarch64/emit-relocs-291-overflow.s: New. * testsuite/ld-aarch64/emit-relocs-291-overflow.d: New. * testsuite/ld-aarch64/emit-relocs-292.d: New. * testsuite/ld-aarch64/emit-relocs-292.s: New. * testsuite/ld-aarch64/emit-relocs-293.d: New. * testsuite/ld-aarch64/emit-relocs-293.s: New.
Diffstat (limited to 'bfd/elfxx-aarch64.c')
-rw-r--r--bfd/elfxx-aarch64.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c
index 9d4aa8fb20b..4fa5682e0d0 100644
--- a/bfd/elfxx-aarch64.c
+++ b/bfd/elfxx-aarch64.c
@@ -301,6 +301,10 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
case BFD_RELOC_AARCH64_MOVW_G0_S:
case BFD_RELOC_AARCH64_MOVW_G1_S:
case BFD_RELOC_AARCH64_MOVW_G2_S:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G0:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G1:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G2:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G3:
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0:
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1:
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2:
@@ -333,6 +337,9 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
case BFD_RELOC_AARCH64_MOVW_G3:
case BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC:
case BFD_RELOC_AARCH64_MOVW_GOTOFF_G1:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G0_NC:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G1_NC:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G2_NC:
case BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC:
case BFD_RELOC_AARCH64_TLSDESC_OFF_G1:
case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC:
@@ -395,6 +402,13 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type,
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
case BFD_RELOC_AARCH64_BRANCH19:
case BFD_RELOC_AARCH64_LD_LO19_PCREL:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G0:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G0_NC:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G1:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G1_NC:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G2:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G2_NC:
+ case BFD_RELOC_AARCH64_MOVW_PREL_G3:
case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21:
case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19:
case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21: