[PATCH] x86-64: certain pcrel expressions broken

Jan Beulich JBeulich@novell.com
Tue Mar 29 16:20:00 GMT 2005


While expressions like "sym - ." were correctly converted to use pc-relative
relocations for 8-, 16-, and 32-bit operations, sign-extended 32-bit operands
of 64-bit operations didn't get converted.

Built and tested on x86_64-unknown-linux-gnu.

Jan

gas/
2005-03-29  Jan Beulich  <jbeulich@novell.com>

	* config/tc-i386.c (md_apply_fix3): Also handle BFD_RELOC_X86_64_32S.
	(tc_gen_reloc): Handle BFD_RELOC_X86_64_32S in the default case.

--- /home/jbeulich/src/binutils/mainline/2005-03-29/gas/config/tc-i386.c	2005-03-14 15:08:07.000000000 +0100
+++ 2005-03-29/gas/config/tc-i386.c	2005-03-29 15:51:21.258603448 +0200
@@ -4798,6 +4798,7 @@ md_apply_fix3 (fixP, valP, seg)
 	  break;
 
 	case BFD_RELOC_32:
+	case BFD_RELOC_X86_64_32S:
 	  fixP->fx_r_type = BFD_RELOC_32_PCREL;
 	  break;
 	case BFD_RELOC_16:
@@ -5361,7 +5362,6 @@ tc_gen_reloc (section, fixp)
     case BFD_RELOC_386_TLS_GOTIE:
     case BFD_RELOC_386_TLS_LE_32:
     case BFD_RELOC_386_TLS_LE:
-    case BFD_RELOC_X86_64_32S:
     case BFD_RELOC_X86_64_TLSGD:
     case BFD_RELOC_X86_64_TLSLD:
     case BFD_RELOC_X86_64_DTPOFF32:


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: binutils-mainline-x86_64-pcrel.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20050329/0fa42ce7/attachment.ksh>


More information about the Binutils mailing list