From e09ab7ac788fd5509adc40b86a3631a3028c1d33 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 4 Mar 2015 09:08:49 +0000 Subject: Allow MOVK for R_AARCH64_TLSLE_MOVW_TPREL_G{0,1}NC bfd/ PR gas/17843 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Expect R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC to be used with MOVK rather than MOVZ. gas/ PR gas/17843 * config/tc-aarch64.c (process_movw_reloc_info): Allow R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC for MOVK. gas/testsuite/ PR gas/17843 * gas/aarch64/tls.s, gas/aarch64/tls.d: Add test for R_AARCH64_TLSLE_MOVW_TPREL_G0/R_AARCH64_TLSLE_MOVW_TPREL_G1_NC sequence. ld/testsuite/ PR gas/17843 * ld-aarch64/tlsle.s, ld-aarch64/tlsle.d: New test. * ld-aarch64/aarch64-elf.exp: Run it. --- gas/ChangeLog | 7 +++++++ gas/config/tc-aarch64.c | 2 -- gas/testsuite/ChangeLog | 7 +++++++ gas/testsuite/gas/aarch64/tls.d | 4 ++++ gas/testsuite/gas/aarch64/tls.s | 3 +++ 5 files changed, 21 insertions(+), 2 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index d5cc47f..d6d6c95 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2015-03-04 Richard Sandiford + + PR gas/17843 + * config/tc-aarch64.c (process_movw_reloc_info): Allow + R_AARCH64_TLSLE_MOVW_TPREL_G0_NC and R_AARCH64_TLSLE_MOVW_TPREL_G1_NC + for MOVK. + 2015-02-28 Alan Modra * write.c (SUB_SEGMENT_ALIGN): Don't pad non-code sections at diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 1e2b182..9179fc6 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -4520,9 +4520,7 @@ process_movw_reloc_info (void) case BFD_RELOC_AARCH64_MOVW_G1_S: case BFD_RELOC_AARCH64_MOVW_G2_S: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0: - case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1: - case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2: set_syntax_error (_("the specified relocation type is not allowed for MOVK")); diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index f19792b..fb6e592 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-03-04 Richard Sandiford + + PR gas/17843 + * gas/aarch64/tls.s, gas/aarch64/tls.d: Add test for + R_AARCH64_TLSLE_MOVW_TPREL_G0/R_AARCH64_TLSLE_MOVW_TPREL_G1_NC + sequence. + 2015-02-28 Alan Modra * gas/sparc/pcrel.d: Update for changed padding in data sections. diff --git a/gas/testsuite/gas/aarch64/tls.d b/gas/testsuite/gas/aarch64/tls.d index 9b79c85..ab67c6a 100644 --- a/gas/testsuite/gas/aarch64/tls.d +++ b/gas/testsuite/gas/aarch64/tls.d @@ -31,3 +31,7 @@ Disassembly of section \.text: 2c: R_AARCH64_TLSLE_ADD_TPREL_HI12 var 30: 91000020 add x0, x1, #0x0 30: R_AARCH64_TLSLE_ADD_TPREL_LO12_NC var + 34: d2a00000 movz x0, #0x0, lsl #16 + 34: R_AARCH64_TLSLE_MOVW_TPREL_G1 var + 38: f2800000 movk x0, #0x0 + 38: R_AARCH64_TLSLE_MOVW_TPREL_G0_NC var diff --git a/gas/testsuite/gas/aarch64/tls.s b/gas/testsuite/gas/aarch64/tls.s index 3098970..5c85409 100644 --- a/gas/testsuite/gas/aarch64/tls.s +++ b/gas/testsuite/gas/aarch64/tls.s @@ -51,3 +51,6 @@ func: add x0, x1, #:tprel_hi12:var, lsl #12 // R_AARCH64_TLSLE_ADD_TPREL_LO12_NC var add x0, x1, #:tprel_lo12_nc:var + + movz x0, #:tprel_g1:var + movk x0, #:tprel_g0_nc:var -- cgit v1.1