Fix .dc.a for x32
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 13 Jun 2012 21:41:07 +0000 (21:41 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 13 Jun 2012 21:41:07 +0000 (21:41 +0000)
gas/

* config/tc-i386.c (x86_address_bytes): New.
* config/tc-i386.h (TC_ADDRESS_BYTES): Likewise.
(x86_address_bytes): Likewise.

gas/testsuite/

* gas/i386/ilp32/x86-64-dc_a.d: New.
* gas/i386/ilp32/x86-64-dc_a.s: Likewise.

gas/ChangeLog
gas/config/tc-i386.c
gas/config/tc-i386.h
gas/testsuite/ChangeLog
gas/testsuite/gas/i386/ilp32/x86-64-dc_a.d [new file with mode: 0644]
gas/testsuite/gas/i386/ilp32/x86-64-dc_a.s [new file with mode: 0644]

index a9fc59ab8a5c6816c58f0e24189151dc515e94d2..7860d0f50398406fedf43570fe04d46aa05200e7 100644 (file)
@@ -1,3 +1,9 @@
+2012-06-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/tc-i386.c (x86_address_bytes): New.
+       * config/tc-i386.h (TC_ADDRESS_BYTES): Likewise.
+       (x86_address_bytes): Likewise.
+
 2012-06-13  Zhenqiang Chen  <zhenqiang.chen@linaro.org>
 
        PR gas/12698
index ccf54bcae5429785559023d4948545f1690c88c2..d2b492762f3a5d9c49e343ab9646e4affc950df9 100644 (file)
@@ -6619,6 +6619,17 @@ x86_cons_fix_new (fragS *frag, unsigned int off, unsigned int len,
   fix_new_exp (frag, off, len, exp, 0, r);
 }
 
+/* Export the ABI address size for use by TC_ADDRESS_BYTES for the
+   purpose of the `.dc.a' internal pseudo-op.  */
+
+int
+x86_address_bytes (void)
+{
+  if ((stdoutput->arch_info->mach & bfd_mach_x64_32))
+    return 4;
+  return stdoutput->arch_info->bits_per_address / 8;
+}
+
 #if !(defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) || defined (OBJ_MACH_O)) \
     || defined (LEX_AT)
 # define lex_got(reloc, adjust, types) NULL
index 51c6cb63826ac91b3d6e118328738429b8c3c87f..d4d7d96e0462b7daf58d7525166636757f2525e7 100644 (file)
@@ -140,6 +140,9 @@ extern void x86_cons (expressionS *, int);
 extern void x86_cons_fix_new
   (fragS *, unsigned int, unsigned int, expressionS *);
 
+#define TC_ADDRESS_BYTES x86_address_bytes
+extern int x86_address_bytes (void);
+
 #define DIFF_EXPR_OK    /* foo-. gets turned into PC relative relocs */
 
 #define NO_RELOC BFD_RELOC_NONE
index a729175c011a846709eb5578e352674d230d5924..1129df01bfeddaf5cfebea4198b76110faa788ee 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * gas/i386/ilp32/x86-64-dc_a.d: New.
+       * gas/i386/ilp32/x86-64-dc_a.s: Likewise.
+
 2012-06-11  Andreas Schwab  <schwab@linux-m68k.org>
 
        * gas/ppc/e500mc.d: Update.
diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-dc_a.d b/gas/testsuite/gas/i386/ilp32/x86-64-dc_a.d
new file mode 100644 (file)
index 0000000..8b2cdcd
--- /dev/null
@@ -0,0 +1,5 @@
+#nm: -n
+#name: x86-64 (ILP32) .dc.a
+
+0+ d foo
+0+4 d bar
diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-dc_a.s b/gas/testsuite/gas/i386/ilp32/x86-64-dc_a.s
new file mode 100644 (file)
index 0000000..4674392
--- /dev/null
@@ -0,0 +1,5 @@
+       .data
+foo:
+       .dc.a 0
+bar:
+       .dc.a 0