public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [COMMITTED][AArch64] Cleanup TLS relocation types which don't go through GOT table
@ 2015-08-18 15:52 Jiong Wang
  0 siblings, 0 replies; only message in thread
From: Jiong Wang @ 2015-08-18 15:52 UTC (permalink / raw)
  To: binutils

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


This patch done two types of cleanup:

  * in aarch64_reloc_got_type and elfNN_aarch64_relocate_section
    
    We don't need those redundant "case" check, as they can be merged
    with the "default" which just "break".

  * in elfNN_aarch64_gc_sweep_hook and elfNN_aarch64_check_relocs
    
    All TLS local executable relocations and some local dynamic
    relocations (those calculate module offset) actually don't need GOT
    entry, so remove them from GOT entry counting.

Native aarch64 build OK and check-ld OK.

Applied as obivious.

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

bfd/
  * elfnn-aarch64.c (aarch64_reloc_got_type): Delete useless check.
  (elfNN_aarch64_relocate_section): Likewise.
  (elfNN_aarch64_gc_sweep_hook): Likewise.
  (elfNN_aarch64_check_relocs): Likewise.

-- 
Regards,
Jiong


[-- Attachment #2: cleanup-tls.patch --]
[-- Type: text/x-diff, Size: 2802 bytes --]

diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 9773e3e..beedb70 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -4193,17 +4193,6 @@ aarch64_reloc_got_type (bfd_reloc_code_real_type r_type)
     case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
       return GOT_TLS_IE;
 
-    case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12:
-    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:
-    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:
-      return GOT_UNKNOWN;
-
     default:
       break;
     }
@@ -5710,16 +5699,6 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
 	    }
 	  break;
 
-	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:
-	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:
-	  break;
-
 	case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC:
 	case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
 	case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21:
@@ -6115,14 +6094,6 @@ elfNN_aarch64_gc_sweep_hook (bfd *abfd,
 	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:
-	case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
-	case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
-	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:
 	  if (h != NULL)
 	    {
 	      if (h->got.refcount > 0)
@@ -6590,14 +6561,6 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	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:
-	case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
-	case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
-	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:
 	  {
 	    unsigned got_type;
 	    unsigned old_got_type;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-18 15:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-18 15:52 [COMMITTED][AArch64] Cleanup TLS relocation types which don't go through GOT table 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).