PERFORCE change 85472 for review

Peter Wemm peter at FreeBSD.org
Mon Oct 17 16:23:39 PDT 2005


http://perforce.freebsd.org/chv.cgi?CH=85472

Change 85472 by peter at 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;
 		    }
 		}
 


More information about the p4-projects mailing list