This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR gas/11974: windows x86_64 sign extension
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Fri, 3 Sep 2010 10:40:25 -0700
- Subject: PATCH: PR gas/11974: windows x86_64 sign extension
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
I checked in this patch to fix 64bit immediate for 64bit Windows.
H.J.
---
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gas/ChangeLog,v
retrieving revision 1.4240
diff -u -p -r1.4240 ChangeLog
--- ChangeLog 2 Sep 2010 22:43:44 -0000 1.4240
+++ ChangeLog 3 Sep 2010 17:37:18 -0000
@@ -1,3 +1,9 @@
+2010-09-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/11974
+ * config/tc-i386.c (i386_finalize_immediate): Check flag_code
+ instead of use_rela_relocations for 64bit.
+
2010-09-02 Richard Henderson <rth@redhat.com>
* dw2gencfi.c (TC_DWARF2_EMIT_OFFSET): Provide default.
Index: config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.447
diff -u -p -r1.447 tc-i386.c
--- config/tc-i386.c 19 Aug 2010 21:04:36 -0000 1.447
+++ config/tc-i386.c 3 Sep 2010 17:37:19 -0000
@@ -6626,8 +6626,8 @@ i386_finalize_immediate (segT exp_seg AT
{
/* Size it properly later. */
i.types[this_operand].bitfield.imm64 = 1;
- /* If BFD64, sign extend val. */
- if (!use_rela_relocations
+ /* If not 64bit, sign extend val. */
+ if (flag_code != CODE_64BIT
&& (exp->X_add_number & ~(((addressT) 2 << 31) - 1)) == 0)
exp->X_add_number
= (exp->X_add_number ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31);
Index: testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gas/testsuite/ChangeLog,v
retrieving revision 1.1728
diff -u -p -r1.1728 ChangeLog
--- testsuite/ChangeLog 3 Sep 2010 15:54:31 -0000 1.1728
+++ testsuite/ChangeLog 3 Sep 2010 17:37:19 -0000
@@ -1,3 +1,9 @@
+2010-09-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/11974
+ * gas/i386/immed64.s: Add more movabs tests.
+ * gas/i386/immed64.d: Updated.
+
2010-09-03 Jan Kratochvil <jan.kratochvil@redhat.com>
* gas/elf/dwarf2-1.d: Update DW_OP_reg5 expected output.
Index: testsuite/gas/i386/immed64.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/immed64.d,v
retrieving revision 1.3
diff -u -p -r1.3 immed64.d
--- testsuite/gas/i386/immed64.d 20 Oct 2009 22:18:18 -0000 1.3
+++ testsuite/gas/i386/immed64.d 3 Sep 2010 17:37:20 -0000
@@ -57,4 +57,6 @@ Disassembly of section \.text:
[ ]*[0-9a-fA-F]+:[ ]+e5 04[ ]+inl? +\$0x4,%eax
[ ]*[0-9a-fA-F]+:[ ]+e5 08[ ]+inl? +\$0x8,%eax
[ ]*[0-9a-fA-F]+:[ ]+e5 00[ ]+inl? +\$0x0,%eax
+[ ]*[a-f0-9]+: 48 b8 01 00 00 80 00 00 00 00 movabs \$0x80000001,%rax
+[ ]*[a-f0-9]+: 48 b8 01 00 00 80 00 00 00 00 movabs \$0x80000001,%rax
#pass
Index: testsuite/gas/i386/immed64.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/immed64.s,v
retrieving revision 1.1
diff -u -p -r1.1 immed64.s
--- testsuite/gas/i386/immed64.s 26 Jul 2005 15:34:11 -0000 1.1
+++ testsuite/gas/i386/immed64.s 3 Sep 2010 17:37:20 -0000
@@ -54,3 +54,6 @@ _start:
inl $xtrn, %eax
.equiv late, 8
+
+ movabs $0x80000001, %rax
+ movabsq $0x80000001, %rax