This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: [csl-arm] Do not mark .init_array/.fini_array writable
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 26 Jan 2005 21:08:47 -0800
- Subject: PATCH: [csl-arm] Do not mark .init_array/.fini_array writable
- Reply-to: mark at codesourcery dot com
On SymbianOS, .init_array and .fini_array do not need to be writable;
therefore, we need to leave out the "w" here.
Applied on the csl-arm-branch.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
2004-01-26 Mark Mitchell <mark@codesourcery.com>
* 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.
Index: config/arm/arm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.210.2.50
diff -c -5 -p -r1.210.2.50 arm.h
*** config/arm/arm.h 21 Jan 2005 22:13:40 -0000 1.210.2.50
--- config/arm/arm.h 27 Jan 2005 05:05:13 -0000
*************** typedef struct
*** 2118,2131 ****
--- 2118,2135 ----
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
arm_asm_output_labelref (FILE, NAME)
/* 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 \
"\t.section\t.dtors,\"aw\",%progbits"
Index: config/arm/symbian.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/symbian.h,v
retrieving revision 1.5.2.9
diff -c -5 -p -r1.5.2.9 symbian.h
*** config/arm/symbian.h 30 Sep 2004 20:10:58 -0000 1.5.2.9
--- config/arm/symbian.h 27 Jan 2005 05:05:13 -0000
***************
*** 79,83 ****
--- 79,92 ----
/* Include the default BPABI stuff. */ \
TARGET_BPABI_CPP_BUILTINS (); \
builtin_define ("__symbian__"); \
} \
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"