This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[AArch64] Don't tail-pads sections to the alignment
- From: Jiong Wang <jiong dot wang at arm dot com>
- To: "binutils\ at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 09 Mar 2015 14:57:01 +0000
- Subject: [AArch64] Don't tail-pads sections to the alignment
- Authentication-results: sourceware.org; auth=none
This patch tell AArch64 assembler don't tail-pads sectio to the
alignment so that we may save a little bit space in some scenarios, like
what x86/ppc/ia64 have done.
For example, given:
.data
.p2align 6
f:
.space 8
the data section should be 8bytes, while currently we are affected by
the above ".p2align 6", thus tail-pad it into 64bytes.
OK for trunk?
Thanks.
2015-03-09 Jiong Wang <jiong.wang@arm.com>
gas/
* config/tc-aarch64.h (SUB_SEGMENT_ALIGN): Define to be zero.
gas/testsuite/
* gas/aarch64/tail_padding.s: New testcase.
* gas/aarch64/tail_padding.d: New expectation file.
diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h
index 19b9eae..86b70d6 100644
--- a/gas/config/tc-aarch64.h
+++ b/gas/config/tc-aarch64.h
@@ -146,6 +146,8 @@ struct aarch64_frag_type
goto LABEL; \
}
+#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0
+
#define DWARF2_LINE_MIN_INSN_LENGTH 4
/* The lr register is r30. */
diff --git a/gas/testsuite/gas/aarch64/tail_padding.d b/gas/testsuite/gas/aarch64/tail_padding.d
new file mode 100644
index 0000000..3a5786a
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/tail_padding.d
@@ -0,0 +1,17 @@
+#readelf: -S
+#name: AArch64 section tail padding
+
+There are .* section headers, starting at offset .*:
+
+Section Headers:
+ \[Nr\] Name Type Address Offset
+ Size EntSize Flags Link Info Align
+ \[ 0\] NULL 0000000000000000 00000000
+ 0000000000000000 0000000000000000 0 0 0
+ \[ 1\] \.text PROGBITS 0000000000000000 00000040
+ 0000000000000000 0000000000000000 AX 0 0 1
+ \[ 2\] \.data PROGBITS 0000000000000000 00000040
+ 0000000000000008 0000000000000000 WA 0 0 64
+ \[ 3\] \.bss NOBITS 0000000000000000 00000080
+ 000000000000000c 0000000000000000 WA 0 0 64
+#...
diff --git a/gas/testsuite/gas/aarch64/tail_padding.s b/gas/testsuite/gas/aarch64/tail_padding.s
new file mode 100644
index 0000000..bbfba5b
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/tail_padding.s
@@ -0,0 +1,13 @@
+/* tail_padding.s Test file for AArch64 tail padding. */
+
+ .data
+ .p2align 6
+f:
+ .space 8
+
+ .bss
+ .p2align 6
+b:
+ .space 6
+ .local c
+ .comm c, 6