[GAS][AARCH64]Add group relocations to create PC-relative offset.
authorRenlin Li <renlin.li@arm.com>
Thu, 18 Jan 2018 12:08:40 +0000 (12:08 +0000)
committerRenlin Li <renlin.li@arm.com>
Wed, 24 Jan 2018 16:19:47 +0000 (16:19 +0000)
commit322474019df79a1305e83ff7620a72f31a5c7b55
treeae7e6030970c16a017c540609ec31f448c6ad32f
parentcc40406d1d033abc21de1af5a30f2a5fbb692507
[GAS][AARCH64]Add group relocations to create PC-relative offset.

This is a patch to add the gas 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>

* reloc.c: Add 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-in2.h: Regenerate.
* libbfd.h: Regenerate.
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries 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.

gas/

2018-01-24  Renlin Li  <renlin.li@arm.com>

* config/tc-aarch64.c (reloc_table): add entries 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.
(process_movw_reloc_info): Supports newly added MOVW_PREL relocations.
(md_apply_fix): Likewise
* testsuite/gas/aarch64/prel_g0.s: New.
* testsuite/gas/aarch64/prel_g0.d: New.
* testsuite/gas/aarch64/prel_g0_nc.s: New.
* testsuite/gas/aarch64/prel_g0_nc.d: New.
* testsuite/gas/aarch64/prel_g1.s: New.
* testsuite/gas/aarch64/prel_g1.d: New.
* testsuite/gas/aarch64/prel_g1_nc.s: New.
* testsuite/gas/aarch64/prel_g1_nc.d: New.
* testsuite/gas/aarch64/prel_g2.s: New.
* testsuite/gas/aarch64/prel_g2.d: New.
* testsuite/gas/aarch64/prel_g2_nc.s: New.
* testsuite/gas/aarch64/prel_g2_nc.d: New.
* testsuite/gas/aarch64/prel_g3.s: New.
* testsuite/gas/aarch64/prel_g3.d: New.
21 files changed:
bfd/ChangeLog
bfd/bfd-in2.h
bfd/elfnn-aarch64.c
bfd/libbfd.h
bfd/reloc.c
gas/ChangeLog
gas/config/tc-aarch64.c
gas/testsuite/gas/aarch64/reloc-prel_g0.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g0.s [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g0_nc.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g0_nc.s [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g1.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g1.s [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g1_nc.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g1_nc.s [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g2.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g2.s [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g2_nc.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g2_nc.s [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g3.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/reloc-prel_g3.s [new file with mode: 0644]