This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Don't mark .init_array/.fini_array writable on ARM EABI/SymbianOS
- From: Julian Brown <julian at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Julian Brown <julian at codesourcery dot com>, Paul Brook <paul at codesourcery dot com>
- Date: Thu, 28 Apr 2005 15:36:14 +0100
- Subject: [PATCH] Don't mark .init_array/.fini_array writable on ARM EABI/SymbianOS
Hi,
This is a patch from the csl-arm branch, original message here:
http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01972.html
On SymbianOS, .init_array and .fini_array do not need to be writable;
therefore, we need to leave out the "w" there.
Tested by inspection with cross to arm-none-symbianelf.
OK to apply (pending dependent patch)?
Julian
ChangeLog (Mark Mitchell):
* config/arm/arm.h (ARM_EABI_CTORS_SECTION_OP): Do not define if a
definition has already been provided.
(ARM_EABI_DTORS_SECTION_OP): Likewise.
* config/arm/symbian.h (ARM_EABI_CTORS_SECTION_OP): Define.
(ARM_EABI_DTORS_SECTION_OP): Likewise.
diff -urp ../gcc-init-array/gcc/config/arm/arm.h ./gcc/config/arm/arm.h
--- ../gcc-init-array/gcc/config/arm/arm.h 2005-04-25 13:35:32.000000000 -0700
+++ ./gcc/config/arm/arm.h 2005-04-27 15:49:46.000000000 -0700
@@ -2110,10 +2110,14 @@ typedef struct
/* The EABI specifies that constructors should go in .init_array.
Other targets use .ctors for compatibility. */
+#ifndef ARM_EABI_CTORS_SECTION_OP
#define ARM_EABI_CTORS_SECTION_OP \
"\t.section\t.init_array,\"aw\",%init_array"
+#endif
+#ifndef ARM_EABI_DTORS_SECTION_OP
#define ARM_EABI_DTORS_SECTION_OP \
"\t.section\t.fini_array,\"aw\",%fini_array"
+#endif
#define ARM_CTORS_SECTION_OP \
"\t.section\t.ctors,\"aw\",%progbits"
#define ARM_DTORS_SECTION_OP \
diff -urp ../gcc-init-array/gcc/config/arm/symbian.h ./gcc/config/arm/symbian.h
--- ../gcc-init-array/gcc/config/arm/symbian.h 2005-04-25 12:08:02.000000000 -0700
+++ ./gcc/config/arm/symbian.h 2005-04-27 15:51:58.000000000 -0700
@@ -88,6 +88,14 @@
} \
while (false)
+/* On SymbianOS, these sections are not writable, so we use "a",
+ rather than "aw", for the section attributes. */
+#undef ARM_EABI_CTORS_SECTION_OP
+#define ARM_EABI_CTORS_SECTION_OP \
+ "\t.section\t.init_array,\"a\",%init_array"
+#undef ARM_EABI_DTORS_SECTION_OP
+#define ARM_EABI_DTORS_SECTION_OP \
+ "\t.section\t.fini_array,\"a\",%fini_array"
/* SymbianOS cannot merge entities with vague linkage at runtime. */
#define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P false