public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [AArch64][6/8] LD support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC
@ 2015-07-24 16:09 Jiong Wang
  2015-08-11 15:33 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Jiong Wang @ 2015-07-24 16:09 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 582 bytes --]


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

bfd/
  * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
  BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
  (aarch64_reloc_got_type): Likewise.
  (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.

ld/testsuite/
  * ld-aarch64/tls-small-ld.s: Update testcase.
  
-- 
Regards,
Jiong


[-- Attachment #2: 9.patch --]
[-- Type: text/x-diff, Size: 4625 bytes --]

diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index afc4a80..5a1cde1 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -174,6 +174,7 @@
    || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC	\
    || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC	\
    || (R_TYPE) == BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19	\
+   || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC		\
    || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21		\
    || (R_TYPE) == BFD_RELOC_AARCH64_TLSLD_ADR_PREL21		\
    || (R_TYPE) == BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12	\
@@ -4122,6 +4123,7 @@ aarch64_reloc_got_type (bfd_reloc_code_real_type r_type)
     case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21:
     /* LD share the same GOT entry layout with GD.
        The only difference is module index should be initialized into zero.  */
+    case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
     case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
     case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
       return GOT_TLS_GD;
@@ -5030,6 +5032,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
     case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
     case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
     case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
+    case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
     case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
     case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
       if (globals->root.sgot == NULL)
@@ -5516,6 +5519,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
 	case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
 	case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
 	case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21:
+	case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
 	case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
 	case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
 	  if (! symbol_got_offset_mark_p (input_bfd, h, r_symndx))
@@ -5554,7 +5558,8 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
 		    elfNN_aarch64_bfd_reloc_from_type (r_type);
 
 		  if (real_type == BFD_RELOC_AARCH64_TLSLD_ADR_PREL21
-		      || real_type == BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21)
+		      || real_type == BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21
+		      || real_type == BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC)
 		    {
 		      /* For local dynamic, don't generate DTPREL in any case.
 			 Initialize the DTPREL slot into zero, so we get module
@@ -6058,6 +6063,7 @@ elfNN_aarch64_gc_sweep_hook (bfd *abfd,
 	case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
 	case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
 	case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
+	case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
 	case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
 	case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
 	case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12:
@@ -6536,6 +6542,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
 	case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
 	case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
+	case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
 	case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
 	case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
 	case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12:
diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c
index a51dd7b..75bc253 100644
--- a/bfd/elfxx-aarch64.c
+++ b/bfd/elfxx-aarch64.c
@@ -249,6 +249,7 @@ _bfd_aarch64_elf_put_addend (bfd *abfd,
     case BFD_RELOC_AARCH64_ADD_LO12:
     case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC:
     case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
+    case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
     case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12:
     case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
     case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
@@ -441,6 +442,7 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type,
     case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
     case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
     case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
+    case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
     case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
     case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
       value = PG_OFFSET (value + addend);
diff --git a/ld/testsuite/ld-aarch64/tls-small-ld.s b/ld/testsuite/ld-aarch64/tls-small-ld.s
index 0a8b6b9..1a560fc 100644
--- a/ld/testsuite/ld-aarch64/tls-small-ld.s
+++ b/ld/testsuite/ld-aarch64/tls-small-ld.s
@@ -2,6 +2,7 @@
 
 	.text
 func:
-	add	x1, x2, x3
+	// BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC
+	add	x1, x2, #:tlsldm_lo12:dummy
 	// BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21
 	adrp	x0, :tlsldm:dummy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [AArch64][6/8] LD support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC
  2015-07-24 16:09 [AArch64][6/8] LD support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC Jiong Wang
@ 2015-08-11 15:33 ` Nick Clifton
  2015-08-11 20:35   ` [COMMITTED][AArch64][6/8] " Jiong Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2015-08-11 15:33 UTC (permalink / raw)
  To: Jiong Wang, binutils

Hi Jiong,

> 2015-07-24  Jiong Wang  <jiong.wang@arm.com>
>
> bfd/
>    * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize
>    BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC.
>    (aarch64_reloc_got_type): Likewise.
>    (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.
>
> ld/testsuite/
>    * ld-aarch64/tls-small-ld.s: Update testcase.

Approved - please apply.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [COMMITTED][AArch64][6/8] LD support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC
  2015-08-11 15:33 ` Nick Clifton
@ 2015-08-11 20:35   ` Jiong Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Jiong Wang @ 2015-08-11 20:35 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils


Nick Clifton writes:

> Hi Jiong,
>
>> 2015-07-24  Jiong Wang  <jiong.wang@arm.com>
>>
>> ld/testsuite/
>>    * ld-aarch64/tls-small-ld.s: Update testcase.
>
> Approved - please apply.
>
> Cheers
>    Nick

Pushed the whole patch set to master after cross/native as/ld check OK.

The only difference between patches pushed and reviewed is this 6/8.

s/tlsldm_lo12/tlsldm_lo12_nc/ in ld-aarch64/tls-small-ld.s.

Thanks.

-- 
Regards,
Jiong

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-11 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-24 16:09 [AArch64][6/8] LD support BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC Jiong Wang
2015-08-11 15:33 ` Nick Clifton
2015-08-11 20:35   ` [COMMITTED][AArch64][6/8] " Jiong Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).