Check flag_code instead of use_rela_relocations for 64bit.
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 3 Sep 2010 17:38:38 +0000 (17:38 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 3 Sep 2010 17:38:38 +0000 (17:38 +0000)
gas/

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.

gas/testsuite/

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.

gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/ChangeLog
gas/testsuite/gas/i386/immed64.d
gas/testsuite/gas/i386/immed64.s

index bae8e5fc70493e6bd84070c9c4fa3c80e3213a7c..6774434b8a478bd09e727bf20e1553c8d3cd4bcd 100644 (file)
@@ -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 8533142354c5326c2da72a8b74cc524ceed8f14f..9488ac933e14c7d6a49f43bcac3be0d2e61d23dc 100644 (file)
@@ -6626,8 +6626,8 @@ i386_finalize_immediate (segT exp_seg ATTRIBUTE_UNUSED, expressionS *exp,
     {
       /* 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 93c1b1d9623638e712548bd99d9018aba3b58176..73eee887d5b5c5be9ec231e42544f300275dc758 100644 (file)
@@ -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 e195ffd53cf2252f213fc25b60fbb454e9c29c5d..35492a5a458c24b3a031defca75c0e0153918718 100644 (file)
@@ -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 4e68701e1fa9d126ade8919d4afc0528fe5c6530..265b41924e89f9465d7f8b680061a13bc5997fa5 100644 (file)
@@ -54,3 +54,6 @@ _start:
        inl     $xtrn, %eax
 
        .equiv late, 8
+
+       movabs  $0x80000001, %rax
+       movabsq $0x80000001, %rax