[11/16][binutils][AARCH64]Add relocation support for large memory model. [Binutils]Add TLS IE large memory support

Renlin Li renlin.li@arm.com
Tue Sep 8 17:55:00 GMT 2015


Hi all,

This patch adds the missing TLS IE support for large memory model.

The following access sequence is used to access TLS IE variable:

mrs  tp, tpidr_el0
movz t0, #:gottprel_g1:x1 R_AARCH64_TLSIE_MOVW_GOTTPREL_G1      x1
movk t0, #:gottprel_g0_nc:x1 R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC   x1
ldr  t0, [gp, t0]
add  t0, t0, tp

Basically, the following two relocations are already defined, but not 
fully supported.

AARCH64_TLSIE_MOVW_GOTTPREL_G1
AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC

This patch add the missing GAS and LD support. Testcases are also provided.

Binutils regression test Okay. Okay to commit?

Regards,
Renlin

bfd/ChangeLog:

2015-09-08  Renlin Li <renlin.li@arm.com>

     * reloc.c: Make AARCH64_TLSIE_MOVW_GOTTPREL_G1 and
         AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC defined in alphabetical order.
         * libbfd.h: Regenerate.
         * bfd-in2.h: Likewise.
     * elfnn-aarch64.c (elfNN_aarch64_howto_table): Make
         TLSIE_MOVW_GOTTPREL_G1 check overflow.
     (aarch64_reloc_got_type): Add support for TLSIE_MOVW_GOTTPREL_G1
         and TLSIE_MOVW_GOTTPREL_G0_NC.
     (elfNN_aarch64_final_link_relocate): Likewise.
     (elfNN_aarch64_relocate_section): Likewise.
     (elfNN_aarch64_gc_sweep_hook): Likewise.
     (elfNN_aarch64_check_relocs): Likewise.
     * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
     (_bfd_aarch64_elf_resolve_relocation): Likewise.

gas/ChangeLog:

2015-09-08  Renlin Li <renlin.li@arm.com>

     * config/tc-aarch64.c (reloc_table): Add two entries for
         gottprel_g0_nc and gottprel_g1.
     (process_movw_reloc_info): Add support.
     (md_apply_fix): Likewise.
     (aarch64_force_relocation): Likewise.

gas/testsuite/ChangeLog:

2015-09-08  Renlin Li <renlin.li@arm.com>

     * gas/aarch64/reloc-gottprel_g0_nc.d: New.
     * gas/aarch64/reloc-gottprel_g0_nc.s: New.
     * gas/aarch64/reloc-gottprel_g1.d: New.
     * gas/aarch64/reloc-gottprel_g1.s: New.

ld/testsuite/ChangeLog:

2015-09-08  Renlin Li <renlin.li@arm.com>

     * ld-aarch64/tls-large-ie.d: New.
     * ld-aarch64/tls-large-ie.s: New.
     * ld-aarch64/aarch64-elf.exp: Run new test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0011-tls-large-ie.patch
Type: text/x-patch
Size: 14710 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150908/00b7e036/attachment.bin>


More information about the Binutils mailing list