public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in src/patchsets/binutils/2.22: 50_all_binutils-2.22-hppa-tls-pr13476.patch README.history
@ 2011-12-11 21:02 Mike Frysinger (vapier)
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2011-12-11 21:02 UTC (permalink / raw
  To: gentoo-commits

vapier      11/12/11 21:02:02

  Modified:             README.history
  Added:                50_all_binutils-2.22-hppa-tls-pr13476.patch
  Log:
  add fix from upstrema for hppa tls linking

Revision  Changes    Path
1.5                  src/patchsets/binutils/2.22/README.history

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.22/README.history?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.22/README.history?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.22/README.history?r1=1.4&r2=1.5

Index: README.history
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/binutils/2.22/README.history,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- README.history	5 Dec 2011 21:41:22 -0000	1.4
+++ README.history	11 Dec 2011 21:02:01 -0000	1.5
@@ -1,6 +1,7 @@
-1.1		[pending]
+1.1		11 Dec 2011
 	+ 10_all_binutils-2.22-ppc-textrels.patch
 	+ 40_all_binutils-2.22-s390x-PIC.patch
+	+ 50_all_binutils-2.22-hppa-tls-pr13476.patch
 	+ 62_all_binutils-2.22-hardened-crtbegin.patch 
 
 1.0		21 Nov 2011



1.1                  src/patchsets/binutils/2.22/50_all_binutils-2.22-hppa-tls-pr13476.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.22/50_all_binutils-2.22-hppa-tls-pr13476.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.22/50_all_binutils-2.22-hppa-tls-pr13476.patch?rev=1.1&content-type=text/plain

Index: 50_all_binutils-2.22-hppa-tls-pr13476.patch
===================================================================
http://sourceware.org/bugzilla/show_bug.cgi?id=13476

From 686e13677d144cdc5e5e19edc4b21c02b7165db3 Mon Sep 17 00:00:00 2001
From: Dave Anglin <dave.anglin@nrc.ca>
Date: Sun, 11 Dec 2011 15:42:07 +0000

2011-12-11  John Davis Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	PR binutils/13476
	* elf32-hppa.c (final_link_relocate): Convert R_PARISC_TLS_GD21L,
	R_PARISC_TLS_LDM21L and R_PARISC_TLS_IE21L relocations to
	R_PARISC_DPREL21L when not doing a shared link.  Likewise convert
	R_PARISC_TLS_GD14R, R_PARISC_TLS_LDM14R and R_PARISC_TLS_IE14R to
	R_PARISC_DPREL14R.  Handle R_PARISC_TLS_GD21L, R_PARISC_TLS_LDM21L
	and R_PARISC_TLS_IE21L with R_PARISC_DLTIND21L.

diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index fcf51cf..dcf6df0 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -3349,10 +3349,16 @@ final_link_relocate (asection *input_section,
       switch (r_type)
 	{
 	  case R_PARISC_DLTIND21L:
+	  case R_PARISC_TLS_GD21L:
+	  case R_PARISC_TLS_LDM21L:
+	  case R_PARISC_TLS_IE21L:
 	    r_type = R_PARISC_DPREL21L;
 	    break;
 
 	  case R_PARISC_DLTIND14R:
+	  case R_PARISC_TLS_GD14R:
+	  case R_PARISC_TLS_LDM14R:
+	  case R_PARISC_TLS_IE14R:
 	    r_type = R_PARISC_DPREL14R;
 	    break;
 
@@ -3418,53 +3424,48 @@ final_link_relocate (asection *input_section,
     case R_PARISC_DPREL21L:
     case R_PARISC_DPREL14R:
     case R_PARISC_DPREL14F:
-    case R_PARISC_TLS_GD21L:
-    case R_PARISC_TLS_LDM21L:
-    case R_PARISC_TLS_IE21L:
       /* Convert instructions that use the linkage table pointer (r19) to
 	 instructions that use the global data pointer (dp).  This is the
 	 most efficient way of using PIC code in an incomplete executable,
 	 but the user must follow the standard runtime conventions for
 	 accessing data for this to work.  */
-      if (orig_r_type == R_PARISC_DLTIND21L
-	  || (!info->shared
-	      && (r_type == R_PARISC_TLS_GD21L
-		  || r_type == R_PARISC_TLS_LDM21L
-		  || r_type == R_PARISC_TLS_IE21L)))
+      if (orig_r_type != r_type)
 	{
-	  /* Convert addil instructions if the original reloc was a
-	     DLTIND21L.  GCC sometimes uses a register other than r19 for
-	     the operation, so we must convert any addil instruction
-	     that uses this relocation.  */
-	  if ((insn & 0xfc000000) == ((int) OP_ADDIL << 26))
-	    insn = ADDIL_DP;
-	  else
-	    /* We must have a ldil instruction.  It's too hard to find
-	       and convert the associated add instruction, so issue an
-	       error.  */
-	    (*_bfd_error_handler)
-	      (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
-	       input_bfd,
-	       input_section,
-	       (long) offset,
-	       howto->name,
-	       insn);
-	}
-      else if (orig_r_type == R_PARISC_DLTIND14F)
-	{
-	  /* This must be a format 1 load/store.  Change the base
-	     register to dp.  */
-	  insn = (insn & 0xfc1ffff) | (27 << 21);
+	  if (r_type == R_PARISC_DPREL21L)
+	    {
+	      /* GCC sometimes uses a register other than r19 for the
+		 operation, so we must convert any addil instruction
+		 that uses this relocation.  */
+	      if ((insn & 0xfc000000) == ((int) OP_ADDIL << 26))
+		insn = ADDIL_DP;
+	      else
+		/* We must have a ldil instruction.  It's too hard to find
+		   and convert the associated add instruction, so issue an
+		   error.  */
+		(*_bfd_error_handler)
+		  (_("%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
+		   input_bfd,
+		   input_section,
+		   (long) offset,
+		   howto->name,
+		   insn);
+	    }
+	  else if (r_type == R_PARISC_DPREL14F)
+	    {
+	      /* This must be a format 1 load/store.  Change the base
+		 register to dp.  */
+	      insn = (insn & 0xfc1ffff) | (27 << 21);
+	    }
 	}
 
-    /* For all the DP relative relocations, we need to examine the symbol's
-       section.  If it has no section or if it's a code section, then
-       "data pointer relative" makes no sense.  In that case we don't
-       adjust the "value", and for 21 bit addil instructions, we change the
-       source addend register from %dp to %r0.  This situation commonly
-       arises for undefined weak symbols and when a variable's "constness"
-       is declared differently from the way the variable is defined.  For
-       instance: "extern int foo" with foo defined as "const int foo".  */
+      /* For all the DP relative relocations, we need to examine the symbol's
+	 section.  If it has no section or if it's a code section, then
+	 "data pointer relative" makes no sense.  In that case we don't
+	 adjust the "value", and for 21 bit addil instructions, we change the
+	 source addend register from %dp to %r0.  This situation commonly
+	 arises for undefined weak symbols and when a variable's "constness"
+	 is declared differently from the way the variable is defined.  For
+	 instance: "extern int foo" with foo defined as "const int foo".  */
       if (sym_sec == NULL || (sym_sec->flags & SEC_CODE) != 0)
 	{
 	  if ((insn & ((0x3f << 26) | (0x1f << 21)))
@@ -3481,6 +3482,9 @@ final_link_relocate (asection *input_section,
     case R_PARISC_DLTIND21L:
     case R_PARISC_DLTIND14R:
     case R_PARISC_DLTIND14F:
+    case R_PARISC_TLS_GD21L:
+    case R_PARISC_TLS_LDM21L:
+    case R_PARISC_TLS_IE21L:
     case R_PARISC_TLS_GD14R:
     case R_PARISC_TLS_LDM14R:
     case R_PARISC_TLS_IE14R:
-- 
1.7.6.1







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

only message in thread, other threads:[~2011-12-11 21:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-11 21:02 [gentoo-commits] gentoo commit in src/patchsets/binutils/2.22: 50_all_binutils-2.22-hppa-tls-pr13476.patch README.history Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox