This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[AArch64][4/4] Define TC_ADDRESS_BYTES for GAS
- From: Jiong Wang <jiong dot wang at foss dot arm dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Mon, 5 Dec 2016 17:53:35 +0000
- Subject: [AArch64][4/4] Define TC_ADDRESS_BYTES for GAS
- Authentication-results: sourceware.org; auth=none
- References: <2217462f-42bd-83e0-6141-acd62e8becb8@foss.arm.com> <4a2dc012-d289-319a-3557-14266fe3510b@foss.arm.com> <2eaf8fdb-6e7d-1f9b-8ef3-fe0c1d5577c9@foss.arm.com>
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 */