This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] x86_64: push <symoffs> creates wrong relocation


A suffixless push (as would the the general case with Intel syntax) with
its
operand being the address of a symbol generated an unsigned
(zero-extend)
relocation rather than a signed (sign-extend) one.

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

Jan

gas/
2005-02-28  Jan Beulich  <jbeulich@novell.com>

	* config/tc-i386.c (output_imm): Also set sign flag for 64-bit
push
	immediates.

---
/home/jbeulich/src/binutils/mainline/2005-02-28/gas/config/tc-i386.c	2005-02-01
16:15:56.000000000 +0100
+++ 2005-02-28/gas/config/tc-i386.c	2005-02-28 15:16:27.055461488
+0100
@@ -3560,7 +3560,8 @@ output_imm (insn_start_frag, insn_start_
 	      int sign = 0;
 
 	      if ((i.types[n] & (Imm32S))
-		  && i.suffix == QWORD_MNEM_SUFFIX)
+		  && (i.suffix == QWORD_MNEM_SUFFIX
+		      || (!i.suffix && (i.tm.opcode_modifier &
No_lSuf))))
 		sign = 1;
 	      if (i.types[n] & (Imm8 | Imm8S | Imm16 | Imm64))
 		{

Attachment: binutils-mainline-x86_64-push-symoffs.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]