Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Oct 2005 23:23:38 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 85472 for review
Message-ID:  <200510172323.j9HNNcQR013739@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=85472

Change 85472 by peter@peter_melody on 2005/10/17 23:23:20

	Add a bugfix/workaround to binutils to enable -shared modules without
	-fpic.

Affected files ...

.. //depot/projects/hammer/contrib/binutils/bfd/elf64-x86-64.c#6 edit

Differences ...

==== //depot/projects/hammer/contrib/binutils/bfd/elf64-x86-64.c#6 (text+ko) ====

@@ -784,7 +784,8 @@
 	     non-constant sections.  */
 	  if (info->shared
 	      && (sec->flags & SEC_ALLOC) != 0
-	      && (sec->flags & SEC_READONLY) != 0)
+	      && (sec->flags & SEC_READONLY) != 0
+	      && getenv("BFD_STFU") == NULL)
 	    {
 	      (*_bfd_error_handler)
 		(_("%s: relocation %s can not be used when making a shared object; recompile with -fPIC"),
@@ -1938,6 +1939,11 @@
 	  unresolved_reloc = FALSE;
 	  break;
 
+	case R_X86_64_32S:
+	  if (getenv("BFD_STFU") == NULL) {
+	    break;
+	  }
+	  /* Fall Through */
 	case R_X86_64_PC8:
 	case R_X86_64_PC16:
 	case R_X86_64_PC32:
@@ -2045,7 +2051,10 @@
 			}
 
 		      outrel.r_info = ELF64_R_INFO (sindx, r_type);
-		      outrel.r_addend = relocation + rel->r_addend;
+		      if (r_type == R_X86_64_32S && getenv("BFD_STFU") != NULL)
+			outrel.r_addend = rel->r_addend;
+		      else
+			outrel.r_addend = relocation + rel->r_addend;
 		    }
 		}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510172323.j9HNNcQR013739>