[1/2][GAS][AARCH64]Add BFD_RELOC_AARCH64_TLSLE_LDST8/16/32/64_TPREL_LO12 support in GAS

Renlin Li renlin.li@foss.arm.com
Wed Mar 28 14:54:00 GMT 2018


Hi all,

This is the first patch to add the following relocation support into binutils.
BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.

Those relocations includes both ip64 and ilp32 variant.

Regard,
Renlin

include/ChangeLog:

     2018-03-28  Renlin Li  <renlin.li@arm.com>

         PR ld/22970
         * elf/aarch64.h: Add relocation number for
         R_AARCH64_P32_TLSLE_LDST16_TPREL_LO12,
         R_AARCH64_P32_TLSLE_LDST16_TPREL_LO12_NC,
         R_AARCH64_P32_TLSLE_LDST32_TPREL_LO12,
         R_AARCH64_P32_TLSLE_LDST32_TPREL_LO12_NC,
         R_AARCH64_P32_TLSLE_LDST64_TPREL_LO12,
         R_AARCH64_P32_TLSLE_LDST64_TPREL_LO12_NC,
         R_AARCH64_P32_TLSLE_LDST8_TPREL_LO12,
         R_AARCH64_P32_TLSLE_LDST8_TPREL_LO12_NC.

bfd/ChangeLog:

2018-03-28  Renlin Li  <renlin.li@arm.com>

         PR ld/22970
	* reloc.c: Add BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12
	BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
	BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
	BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
	BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
	BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
	BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
	* elfnn-aarch64.c (elfNN_aarch64_howto_table): Add table entry for
	TLSLE_LDST16_TPREL_LO12,
	TLSLE_LDST16_TPREL_LO12_NC,
	TLSLE_LDST32_TPREL_LO12,
	TLSLE_LDST32_TPREL_LO12_NC,
	TLSLE_LDST64_TPREL_LO12,
	TLSLE_LDST64_TPREL_LO12_NC,
	TLSLE_LDST8_TPREL_LO12,
	TLSLE_LDST8_TPREL_LO12_NC.
	* bfd-in2.h: Regenerated.
	* libbfd.h: Regenerated.

gas/ChangeLog:

2018-03-28  Renlin Li  <renlin.li@arm.com>

         PR ld/22970
	* config/tc-aarch64.c (reloc_table): Update entry for tprel_lo12 and
	tprel_lo12_nc with pseudo relocations.
	(ldst_lo12_determine_real_reloc_type): Add new relocations support.
	(parse_operands): Handle BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12 and
	BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC pseudo relocations.
	(md_apply_fix): Add handling for new relocation.
	(aarch64_force_relocation): Likewise.
	* testsuite/gas/aarch64/reloc-tprel_lo12-ldst16.d: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12-ldst16.s: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12-ldst32.d: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12-ldst32.s: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12-ldst64.d: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12-ldst64.s: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12-ldst8.d: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12-ldst8.s: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst16.d: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst16.s: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst32.d: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst32.s: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst64.d: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst64.s: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst8.d: New.
	* testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst8.s: New.
         * testsuite/gas/aarch64/reloc-tprel_lo12-ldst16-ilp32.d: New.
         * testsuite/gas/aarch64/reloc-tprel_lo12-ldst32-ilp32.d: New.
         * testsuite/gas/aarch64/reloc-tprel_lo12-ldst64-ilp32.d: New.
         * testsuite/gas/aarch64/reloc-tprel_lo12-ldst8-ilp32.d: New.
         * testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst16-ilp32.d: New.
         * testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst32-ilp32.d: New.
         * testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst64-ilp32.d: New.
         * testsuite/gas/aarch64/reloc-tprel_lo12_nc-ldst8-ilp32.d: New.

On 28/03/18 15:52, Renlin Li wrote:
> Hi all,
> 
> This patch is to add the following relocation support into binutils:
> BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12,
> BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC.
> BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12,
> BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,
> BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12,
> BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,
> BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12,
> BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,
> 
> Those relocations includes both ip64 and ilp32 variant.
> Test cases are added.
> 
> This patch will resolve PR22970: https://sourceware.org/bugzilla/show_bug.cgi?id=22970
> 
> Binutils test Okay, Okay to commit?
> 
> Regards,
> Renlin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas.patch
Type: text/x-patch
Size: 29532 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20180328/f877c3a0/attachment.bin>


More information about the Binutils mailing list