This is the mail archive of the binutils@sourceware.org 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]

[AArch64][4/4] Define TC_ADDRESS_BYTES for GAS


Address bytes should be 4 under ILP32, otherwise ".dc.a" will generate 64bit
relocation.

The default address_per_bytes is define in cpu-aarch64.c, current it's 8 for
both LP64 and ILP32, whether we should change it to 4 as well as word_per_bytes
looks to me is another issue we need to investigate.

gas/
2016-12-05  Jiong Wang<jiong.wang@arm.com>

        * config/tc-aarch64.h (TC_ADDRESS_BYTES): New define.
        (aarch64_address_bytes): New declaration.
        * config/tc-aarch64.c (aarch64_address_bytes): New function.

diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 1d25422..af2b5ee 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -8925,3 +8925,14 @@ aarch64_copy_symbol_attributes (symbolS * dest, symbolS * src)
 {
   AARCH64_GET_FLAG (dest) = AARCH64_GET_FLAG (src);
 }
+
+/* Export the ABI address size for use by TC_ADDRESS_BYTES for the
+   purpose of the `.dc.a' internal pseudo-op.  */
+
+int
+aarch64_address_bytes (void)
+{
+  if ((stdoutput->arch_info->mach & bfd_mach_aarch64_ilp32))
+    return 4;
+  return stdoutput->arch_info->bits_per_address / 8;
+}
diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h
index e1bc3a6..f2c5936 100644
--- a/gas/config/tc-aarch64.h
+++ b/gas/config/tc-aarch64.h
@@ -237,4 +237,7 @@ void tc_pe_dwarf2_emit_offset (symbolS *, unsigned int);
 
 #endif /* TE_PE */
 
+#define TC_ADDRESS_BYTES aarch64_address_bytes
+extern int aarch64_address_bytes (void);
+
 #endif /* TC_AARCH64 */

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