[AArch64] Relax TLS local dynamic traditional into local executable
authorJiong Wang <jiong.wang@arm.com>
Wed, 9 Sep 2015 13:19:28 +0000 (14:19 +0100)
committerJiong Wang <jiong.wang@arm.com>
Wed, 9 Sep 2015 13:19:28 +0000 (14:19 +0100)
commit259364adb8ced6dc0e3ae5bec2c6f76ec3faf955
tree627eebda6b2a1f5890f871f441fcba76315ac9a4
parentd660d56578248bf3bb56150295cecc763f112061
[AArch64] Relax TLS local dynamic traditional into local executable

The linker relaxation logic will be:

Code sequence I (tiny):

    0x00 adr  x0, :tlsldm:x
    0x04 bl   __tls_get_addr
         |
         V
    0x00 mrs  x0, tpidr_el0
    0x04 add  x0, x0, TCB_SIZE

Code sequence II (small):

    0x00 adrp a0, :tlsldm:x
    0x04 add  a0, #:tlsldm_lo12:x
    0x08 bl   __tls_get_addr
         |
         V
    0x00 mrs  x0, tpidr_el0
    0x04 add  x0, x0, TCB_SIZE
    0x08 nop

2015-09-09  Jiong Wang  <jiong.wang@arm.com>

bfd/
  * elfnn-aarch64.c (aarch64_tls_transition_without_check): Support
  three TLS local dynamic traditional relocations types.
  (elfNN_aarch64_tls_relax): Support TLS local dynamic traditional to
  local executable relaxation.

ld/testsuite/
  * ld-aarch64/tls-relax-ld-le-tiny.s: New testcase.
  * ld-aarch64/tls-relax-ld-le-small.s: Likewise.
  * ld-aarch64/tls-relax-ld-le-tiny.d: New expectation file.
  * ld-aarch64/tls-relax-ld-le-small.d: Likewise.
  * ld-aarch64/aarch64-elf.exp: Run new testcases.
bfd/ChangeLog
bfd/elfnn-aarch64.c
ld/testsuite/ChangeLog
ld/testsuite/ld-aarch64/aarch64-elf.exp
ld/testsuite/ld-aarch64/tls-relax-ld-le-small.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/tls-relax-ld-le-small.s [new file with mode: 0644]
ld/testsuite/ld-aarch64/tls-relax-ld-le-tiny.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/tls-relax-ld-le-tiny.s [new file with mode: 0644]