aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorRichard Earnshaw <Richard.Earnshaw@arm.com>2015-04-24 15:51:49 +0100
committerRichard Earnshaw <Richard.Earnshaw@arm.com>2015-04-24 15:54:39 +0100
commit7a5c933c7c2c3926b13a047c64f2af1d3ce8e1db (patch)
tree0b5f30e87f378b8034f88bb95e2f23cb9f9b989e /gas
parentde7669bfa507d78f7abfe3d219b5aee9f346235e (diff)
downloadgdb-7a5c933c7c2c3926b13a047c64f2af1d3ce8e1db.zip
gdb-7a5c933c7c2c3926b13a047c64f2af1d3ce8e1db.tar.gz
gdb-7a5c933c7c2c3926b13a047c64f2af1d3ce8e1db.tar.bz2
[ARM]: Don't tail-pad over-aligned functions to the alignment boundary.
2015-04/24 Richard Earnshaw <rearnsha@arm.com> gas/ * config/tc-arm.h (arm_min): New function. (SUB_SEGMENT_ALIGN): Define. gas/testsuite/ * gas/arm/align64.d: Delete trailing padding NOPs. ld/testsuite/ * ld-arm/armthumb-lib.d: Regenerate expected output. * ld-arm/armthumb-lib.d: Likewise. * ld-arm/armthumb-lib.sym: Likewise. * ld-arm/cortex-a8-fix-b-rel-arm.d: Likewise. * ld-arm/cortex-a8-fix-b-rel-thumb.d: Likewise. * ld-arm/cortex-a8-fix-b.d: Likewise. * ld-arm/cortex-a8-fix-bcc-rel-thumb.d: Likewise. * ld-arm/cortex-a8-fix-bcc.d: Likewise. * ld-arm/cortex-a8-fix-bl-rel-arm.d: Likewise. * ld-arm/cortex-a8-fix-bl-rel-plt.d: Likewise. * ld-arm/cortex-a8-fix-bl-rel-thumb.d: Likewise. * ld-arm/cortex-a8-fix-bl.d: Likewise. * ld-arm/cortex-a8-fix-blx-bcond.d: Likewise. * ld-arm/cortex-a8-fix-blx-rel-arm.d: Likewise. * ld-arm/cortex-a8-fix-blx-rel-thumb.d: Likewise. * ld-arm/cortex-a8-fix-blx.d: Likewise. * ld-arm/cortex-a8-fix-hdr.d: Likewise. * ld-arm/farcall-mixed-app-v5.d: Likewise. * ld-arm/farcall-mixed-app.d: Likewise. * ld-arm/farcall-mixed-lib-v4t.d: Likewise. * ld-arm/farcall-mixed-lib.d: Likewise. * ld-arm/mixed-app-v5.d: Likewise. * ld-arm/mixed-app.d: Likewise. * ld-arm/mixed-lib.d: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-arm.h9
-rw-r--r--gas/testsuite/ChangeLog4
-rw-r--r--gas/testsuite/gas/arm/align64.d15
4 files changed, 18 insertions, 15 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 4bdbe5d..7ea12d9 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2015-04/24 Richard Earnshaw <rearnsha@arm.com>
+
+ * config/tc-arm.h (arm_min): New function.
+ (SUB_SEGMENT_ALIGN): Define.
+
2015-04-23 Matthew Fortune <matthew.fortune@imgtec.com>
* config/tc-mips.c (macro): State the recommended way of creating
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h
index b604f04..2216267 100644
--- a/gas/config/tc-arm.h
+++ b/gas/config/tc-arm.h
@@ -236,10 +236,19 @@ struct arm_frag_type
#endif
};
+static inline int
+arm_min (int am_p1, int am_p2)
+{
+ return am_p1 < am_p2 ? am_p1 : am_p2;
+}
+
#define TC_FRAG_TYPE struct arm_frag_type
/* NOTE: max_chars is a local variable from frag_var / frag_variant. */
#define TC_FRAG_INIT(fragp) arm_init_frag (fragp, max_chars)
#define HANDLE_ALIGN(fragp) arm_handle_align (fragp)
+#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \
+ ((!(FRCHAIN)->frch_next && subseg_text_p (SEG)) \
+ ? arm_min (2, get_recorded_alignment (SEG)) : 0)
#define md_do_align(N, FILL, LEN, MAX, LABEL) \
if (FILL == NULL && (N) != 0 && ! need_pass_2 && subseg_text_p (now_seg)) \
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index c28a6a2..8a62d53 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-24 Richard Earnshaw <rearnsha@arm.com>
+
+ * gas/arm/align64.d: Delete trailing padding NOPs.
+
2015-04-23 Matthew Fortune <matthew.fortune@imgtec.com>
* gas/mips/dla-warn.l: New file.
diff --git a/gas/testsuite/gas/arm/align64.d b/gas/testsuite/gas/arm/align64.d
index cee7442..ee67c82 100644
--- a/gas/testsuite/gas/arm/align64.d
+++ b/gas/testsuite/gas/arm/align64.d
@@ -52,18 +52,3 @@ Disassembly of section .text:
00000078 <foo2\+0x34> e1a00000.*nop.*
0000007c <foo2\+0x38> e1a00000.*nop.*
00000080 <foo2\+0x3c> e3a00004.*mov.*r0, #4
-00000084 <foo2\+0x40> e1a00000.*nop.*
-00000088 <foo2\+0x44> e1a00000.*nop.*
-0000008c <foo2\+0x48> e1a00000.*nop.*
-00000090 <foo2\+0x4c> e1a00000.*nop.*
-00000094 <foo2\+0x50> e1a00000.*nop.*
-00000098 <foo2\+0x54> e1a00000.*nop.*
-0000009c <foo2\+0x58> e1a00000.*nop.*
-000000a0 <foo2\+0x5c> e1a00000.*nop.*
-000000a4 <foo2\+0x60> e1a00000.*nop.*
-000000a8 <foo2\+0x64> e1a00000.*nop.*
-000000ac <foo2\+0x68> e1a00000.*nop.*
-000000b0 <foo2\+0x6c> e1a00000.*nop.*
-000000b4 <foo2\+0x70> e1a00000.*nop.*
-000000b8 <foo2\+0x74> e1a00000.*nop.*
-000000bc <foo2\+0x78> e1a00000.*nop.*