Skip to content

Commit 13289c1

Browse files
author
Jiong Wang
committed
[AArch64][1/6] GAS support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC
2015-08-19 Jiong Wang <jiong.wang@arm.com> bfd/ * reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC): New entry. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC. gas/ * config/tc-aarch64.c (reloc_table): New relocation modifiers. (md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC. (aarch64_force_relocation): Likewise. gas/testsuite/ * gas/aarch64/reloc-dtprel_lo12_nc.s: New testcase. * gas/aarch64/reloc-dtprel_lo12_nc-ilp32.s: Likewise. * gas/aarch64/reloc-dtprel_lo12_nc.d: New expectation file. * gas/aarch64/reloc-dtprel_lo12_nc-ilp32.d: Likewise.
1 parent 45face3 commit 13289c1

13 files changed

Lines changed: 85 additions & 0 deletions

‎bfd/ChangeLog‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2015-08-19 Jiong Wang <jiong.wang@arm.com>
2+
3+
* reloc.c (BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC): New entry.
4+
* bfd-in2.h: Regenerate.
5+
* libbfd.h: Regenerate.
6+
* elfnn-aarch64.c (elfNN_aarch64_howto_table): New entry for
7+
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
8+
19
2015-08-19 Alan Modra <amodra@gmail.com>
210

311
* elf-s390-common.c: Simplify expressions using

‎bfd/bfd-in2.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5797,6 +5797,9 @@ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */
57975797
/* Unsigned 12 bit byte offset to module TLS base address. */
57985798
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12,
57995799

5800+
/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
5801+
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
5802+
58005803
/* Unsigned 12 bit byte offset to global offset table entry for a symbols
58015804
tls_index structure. Used in conjunction with
58025805
BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */

‎bfd/elfnn-aarch64.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,21 @@ static reloc_howto_type elfNN_aarch64_howto_table[] =
10571057
0xfff, /* dst_mask */
10581058
FALSE), /* pcrel_offset */
10591059

1060+
/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */
1061+
HOWTO (AARCH64_R (TLSLD_ADD_DTPREL_LO12_NC), /* type */
1062+
0, /* rightshift */
1063+
2, /* size (0 = byte, 1 = short, 2 = long) */
1064+
12, /* bitsize */
1065+
FALSE, /* pc_relative */
1066+
0, /* bitpos */
1067+
complain_overflow_dont, /* complain_on_overflow */
1068+
bfd_elf_generic_reloc, /* special_function */
1069+
AARCH64_R_STR (TLSLD_ADD_DTPREL_LO12_NC), /* name */
1070+
FALSE, /* partial_inplace */
1071+
0xfff, /* src_mask */
1072+
0xfff, /* dst_mask */
1073+
FALSE), /* pcrel_offset */
1074+
10601075
/* ADD: GOT offset G(S) & 0xff8 [no overflow check] */
10611076
HOWTO (AARCH64_R (TLSLD_ADD_LO12_NC), /* type */
10621077
0, /* rightshift */

‎bfd/libbfd.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,6 +2760,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
27602760
"BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC",
27612761
"BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19",
27622762
"BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12",
2763+
"BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC",
27632764
"BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC",
27642765
"BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21",
27652766
"BFD_RELOC_AARCH64_TLSLD_ADR_PREL21",

‎bfd/reloc.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6847,6 +6847,10 @@ ENUM
68476847
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12
68486848
ENUMDOC
68496849
Unsigned 12 bit byte offset to module TLS base address.
6850+
ENUM
6851+
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC
6852+
ENUMDOC
6853+
No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12.
68506854
ENUM
68516855
BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC
68526856
ENUMDOC

‎gas/ChangeLog‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2015-08-19 Jiong Wang <jiong.wang@arm.com>
2+
3+
* config/tc-aarch64.c (reloc_table): New relocation modifiers.
4+
(md_apply_fix): Support BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
5+
(aarch64_force_relocation): Likewise.
6+
17
2015-08-17 Alan Modra <amodra@gmail.com>
28

39
* gas/config/tc-arm.c (s_align): Delete.

‎gas/config/tc-aarch64.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,6 +2531,15 @@ static struct reloc_table_entry reloc_table[] = {
25312531
0,
25322532
0},
25332533

2534+
/* Same as dtprel_lo12, no overflow check. */
2535+
{"dtprel_lo12_nc", 0,
2536+
0, /* adr_type */
2537+
0,
2538+
0,
2539+
BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,
2540+
0,
2541+
0},
2542+
25342543
/* Get to the page containing GOT TLS entry for a symbol */
25352544
{"gottprel", 0,
25362545
0, /* adr_type */
@@ -6797,6 +6806,7 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg)
67976806
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
67986807
case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
67996808
case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12:
6809+
case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC:
68006810
case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
68016811
case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
68026812
case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
@@ -7010,6 +7020,7 @@ aarch64_force_relocation (struct fix *fixp)
70107020
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
70117021
case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
70127022
case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12:
7023+
case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC:
70137024
case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
70147025
case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
70157026
case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:

‎gas/testsuite/ChangeLog‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2015-08-19 Jiong Wang <jiong.wang@arm.com>
2+
3+
* gas/aarch64/reloc-dtprel_lo12_nc.s: New testcase.
4+
* gas/aarch64/reloc-dtprel_lo12_nc-ilp32.s: Likewise.
5+
* gas/aarch64/reloc-dtprel_lo12_nc.d: New expectation file.
6+
* gas/aarch64/reloc-dtprel_lo12_nc-ilp32.d: Likewise.
7+
18
2015-08-13 Andre Vieira <andre.simoesdiasvieira@arm.com>
29

310
* gas/arm/nops.d: New.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#as: -mabi=ilp32
2+
#objdump: -dr
3+
4+
.*: file format .*
5+
6+
Disassembly of section \.text:
7+
8+
00000000 <.*>:
9+
0: 110002a8 add w8, w21, #0x0
10+
0: R_AARCH64_P32_TLSLD_ADD_DTPREL_LO12_NC x
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Test file for AArch64 GAS -- dtprel_lo12_nc ILP32
2+
3+
func:
4+
// BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC
5+
add w8, w21, #:dtprel_lo12_nc:x

0 commit comments

Comments
 (0)