This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[Patch, ARM] Add EABI alignment attributes to generated assembly files


Most of the attributes specified by the ABI for the ARM Architecture
default to values which are fairly portable.  However, the
aligment-preservation attribute defaults to implying that objects are
only maintained to 4-byte alignment.  This means that assembly files
that do not explicitly state a higher alignment can appear to be
non-conforming to the ABI.  This patch fixes this for the assembly files
in libgcc by adding the required attribute to each object.

Tested on arm-eabi and committed to trunk.

2010-04-17  Richard Earnshaw  <rearnsha@arm.com>

	* arm/bpabi.S: Add EABI alignment attributes to objects.
	* arm/bpabi-v6m.S: Likewise.
	* arm/crti.asm: Likewise.
	* arm/crtn.asm: Likewise.
	* arm/lib1funcs.asm: Likewise.
	* arm/libunwind.S: Likewise.

diff --git a/gcc/config/arm/bpabi-v6m.S b/gcc/config/arm/bpabi-v6m.S
index 75d50d9..db1d0ed 100644
--- a/gcc/config/arm/bpabi-v6m.S
+++ b/gcc/config/arm/bpabi-v6m.S
@@ -22,6 +22,16 @@
    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifdef __ARM_EABI__
+/* Some attributes that are common to all routines in this file.  */
+	/* Tag_ABI_align_needed: This code does not require 8-byte
+	   alignment from the caller.  */
+	/* .eabi_attribute 24, 0  -- default setting.  */
+	/* Tag_ABI_align_preserved: This code preserves 8-byte
+	   alignment in any callee.  */
+	.eabi_attribute 25, 1
+#endif /* __ARM_EABI__ */
+
 #ifdef L_aeabi_lcmp
 
 FUNC_START aeabi_lcmp
diff --git a/gcc/config/arm/bpabi.S b/gcc/config/arm/bpabi.S
index ccc569e..10e0f95 100644
--- a/gcc/config/arm/bpabi.S
+++ b/gcc/config/arm/bpabi.S
@@ -22,6 +22,16 @@
    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifdef __ARM_EABI__
+/* Some attributes that are common to all routines in this file.  */
+	/* Tag_ABI_align_needed: This code does not require 8-byte
+	   alignment from the caller.  */
+	/* .eabi_attribute 24, 0  -- default setting.  */
+	/* Tag_ABI_align_preserved: This code preserves 8-byte
+	   alignment in any callee.  */
+	.eabi_attribute 25, 1
+#endif /* __ARM_EABI__ */
+
 #ifdef L_aeabi_lcmp
 
 ARM_FUNC_START aeabi_lcmp
diff --git a/gcc/config/arm/crti.asm b/gcc/config/arm/crti.asm
index 310d784..bda56c5 100644
--- a/gcc/config/arm/crti.asm
+++ b/gcc/config/arm/crti.asm
@@ -35,6 +35,15 @@
 #else
 #define TYPE(x)
 #endif
+#ifdef __ARM_EABI__
+/* Some attributes that are common to all routines in this file.  */
+	/* Tag_ABI_align_needed: This code does not require 8-byte
+	   alignment from the caller.  */
+	/* .eabi_attribute 24, 0  -- default setting.  */
+	/* Tag_ABI_align_preserved: This code preserves 8-byte
+	   alignment in any callee.  */
+	.eabi_attribute 25, 1
+#endif /* __ARM_EABI__ */
 
 	# Note - this macro is complemented by the FUNC_END macro
 	# in crtn.asm.  If you change this macro you must also change
diff --git a/gcc/config/arm/crtn.asm b/gcc/config/arm/crtn.asm
index 006b7d5..e4d5980 100644
--- a/gcc/config/arm/crtn.asm
+++ b/gcc/config/arm/crtn.asm
@@ -26,6 +26,16 @@
 .previous
 #endif
 
+#ifdef __ARM_EABI__
+/* Some attributes that are common to all routines in this file.  */
+	/* Tag_ABI_align_needed: This code does not require 8-byte
+	   alignment from the caller.  */
+	/* .eabi_attribute 24, 0  -- default setting.  */
+	/* Tag_ABI_align_preserved: This code preserves 8-byte
+	   alignment in any callee.  */
+	.eabi_attribute 25, 1
+#endif /* __ARM_EABI__ */
+
 # This file just makes sure that the .fini and .init sections do in
 # fact return.  Users may put any desired instructions in those sections.
 # This file is the last thing linked into any executable.
diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm
index cd64da3..34aa23e 100644
--- a/gcc/config/arm/lib1funcs.asm
+++ b/gcc/config/arm/lib1funcs.asm
@@ -31,10 +31,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #ifdef __ARM_EABI__
 /* Some attributes that are common to all routines in this file.  */
-	/* Tag_ABI_align8_needed: This code does not require 8-byte
+	/* Tag_ABI_align_needed: This code does not require 8-byte
 	   alignment from the caller.  */
 	/* .eabi_attribute 24, 0  -- default setting.  */
-	/* Tag_ABI_align8_preserved: This code preserves 8-byte 
+	/* Tag_ABI_align_preserved: This code preserves 8-byte
 	   alignment in any callee.  */
 	.eabi_attribute 25, 1
 #endif /* __ARM_EABI__ */
diff --git a/gcc/config/arm/libunwind.S b/gcc/config/arm/libunwind.S
index 800e7e0..b04e417 100644
--- a/gcc/config/arm/libunwind.S
+++ b/gcc/config/arm/libunwind.S
@@ -27,6 +27,16 @@
 .previous
 #endif
 
+#ifdef __ARM_EABI__
+/* Some attributes that are common to all routines in this file.  */
+	/* Tag_ABI_align_needed: This code does not require 8-byte
+	   alignment from the caller.  */
+	/* .eabi_attribute 24, 0  -- default setting.  */
+	/* Tag_ABI_align_preserved: This code preserves 8-byte
+	   alignment in any callee.  */
+	.eabi_attribute 25, 1
+#endif /* __ARM_EABI__ */
+
 #ifndef __symbian__
 
 #include "lib1funcs.asm"

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