[PATCH] x86-64: certain pcrel expressions broken

Andreas Jaeger aj@suse.de
Wed Mar 30 10:14:00 GMT 2005


"Jan Beulich" <JBeulich@novell.com> writes:

> 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.

Do you have a testcase?

Andreas

> 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:
>
>
>

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20050330/c997b344/attachment.sig>


More information about the Binutils mailing list