[16/16][binutils][AARCH64]Add relocation support for large memory model. [LD]Add TLSIE relaxation support.

Renlin Li renlin.li@arm.com
Tue Sep 8 18:04:00 GMT 2015


Hi all,

This patch add the TLSIE to TLSLE relax for large memory model. We can 
do the following relaxation if the symbol is local.

      mrs tp, tpidr_el0
      movz tx, #:gottprel_g1:var       => movz tx, #:tprel_g2:var, lsl #32
      movk tx, #:gottprel_g0_nc:var  => movk tx, #:tprel_g1_nc:var, lsl #16
      ldr tx, [gp, tx]                             => movk tx, 
#:tprel_g0_nc:var
      add tx, tx, tp

At the moment, the offset from TP is already known. One addition 
argument is added to elfNN_aarch64_tls_relax function to pass this 
information inside. And during the relaxation, it's directly encoded 
into the instruction word, and the relocation are removed, mark them as 
resolved.

binutils, ld regresstion test Okay without issues.

Regards,
Renlin Li

bfd/ChangeLog:

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

     * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Add
         TLSIE_MOVW_GOTTPREL_G1.
     (aarch64_tls_transition_without_check): Add
         TLSIE_MOVW_GOTTPREL_G1 to TLSLE_MOVW_TPREL_G2
         transition for local symbol.
     (elfNN_aarch64_tls_relax): Add a argument to pass tp offset.
         Add TLSIE_MOVW_GOTTPREL_G1 relaxation.
     (elfNN_aarch64_relocate_section): Call elfNN_aarch64_tls_relax
         with new argument.

ld/testsuite/ChangeLog:

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

     * ld-aarch64/aarch64-elf.exp (tls-relax-large-le-ie): Run new test.
     * ld-aarch64/tls-relax-large-ie-le.d: New.
     * ld-aarch64/tls-relax-large-ie-le.s: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0016-large-tlsie-le-relax.patch
Type: text/x-patch
Size: 5282 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150908/85acfd3c/attachment.bin>


More information about the Binutils mailing list