aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Demetriou <cgd@sibyte.com>2000-08-11 03:18:05 +0000
committerJeff Law <law@gcc.gnu.org>2000-08-10 21:18:05 -0600
commit204772eb9cf51b539eb07fc4aa8beba0a971e6a4 (patch)
treec7bdd6516ce15644a04355dfeadece8dffaca3a0
parent366a0fd8043a51bcd6e2f81004cde8d9607331e2 (diff)
downloadgcc-204772eb9cf51b539eb07fc4aa8beba0a971e6a4.zip
gcc-204772eb9cf51b539eb07fc4aa8beba0a971e6a4.tar.gz
gcc-204772eb9cf51b539eb07fc4aa8beba0a971e6a4.tar.bz2
elf.h (CTOR_SECTION_NAME, [...]): New macros define the name of CTOR and DTOR sections.
* mips/elf.h (CTOR_SECTION_NAME, DTOR_SECTION_NAME): New macros define the name of CTOR and DTOR sections. (CTOR_LIST_BEGIN, CTOR_LIST_END, DTOR_LIST_BEGIN, DTOR_LIST_END): Change to use attributes to specify sections. * mips/elf64.h (CTOR_SECTION_NAME, DTOR_SECTION_NAME, (CTOR_LIST_BEGIN, CTOR_LIST_END, DTOR_LIST_BEGIN, DTOR_LIST_END): Same as in mips/elf.h. From-SVN: r35618
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/mips/elf.h29
-rw-r--r--gcc/config/mips/elf64.h29
3 files changed, 43 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 570ba13..69d87c1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2000-08-10 Chris Demetriou <cgd@sibyte.com>
+
+ * mips/elf.h (CTOR_SECTION_NAME, DTOR_SECTION_NAME): New
+ macros define the name of CTOR and DTOR sections.
+ (CTOR_LIST_BEGIN, CTOR_LIST_END, DTOR_LIST_BEGIN,
+ DTOR_LIST_END): Change to use attributes to specify
+ sections.
+ * mips/elf64.h (CTOR_SECTION_NAME, DTOR_SECTION_NAME,
+ (CTOR_LIST_BEGIN, CTOR_LIST_END, DTOR_LIST_BEGIN,
+ DTOR_LIST_END): Same as in mips/elf.h.
+
2000-08-10 Drew Moseley <dmoseley@redhat.com>
* config/mn10300/mn10300.h: Added no-crt0 option for explicitly
diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h
index 5617355..8e6907e 100644
--- a/gcc/config/mips/elf.h
+++ b/gcc/config/mips/elf.h
@@ -275,7 +275,8 @@ do { \
/* Support the ctors/dtors and other sections. */
-/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+/* Define the names of and pseudo-ops used to switch to the .ctors and
+ .dtors sections.
Note that we want to give these sections the SHF_WRITE attribute
because these sections will actually contain data (i.e. tables of
@@ -290,7 +291,9 @@ do { \
errors unless the .ctors and .dtors sections are marked as writable
via the SHF_WRITE attribute.) */
+#define CTORS_SECTION_NAME ".ctors"
#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"aw\""
+#define DTORS_SECTION_NAME ".dtors"
#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"aw\""
/* There's no point providing a default definition of __CTOR_LIST__
@@ -345,21 +348,21 @@ void FN () \
fprintf (FILE, "\n"); \
} while (0)
-#define CTOR_LIST_BEGIN \
-asm (CTORS_SECTION_ASM_OP); \
-func_ptr __CTOR_LIST__ = (func_ptr) (-1)
+#define CTOR_LIST_BEGIN \
+func_ptr __CTOR_LIST__ __attribute__((section(CTORS_SECTION_NAME))) = \
+ (func_ptr) (-1)
-#define CTOR_LIST_END \
-asm (CTORS_SECTION_ASM_OP); \
-func_ptr __CTOR_END__ = (func_ptr) 0
+#define CTOR_LIST_END \
+func_ptr __CTOR_END__ __attribute__((section(CTORS_SECTION_NAME))) = \
+ (func_ptr) 0
-#define DTOR_LIST_BEGIN \
-asm (DTORS_SECTION_ASM_OP); \
-func_ptr __DTOR_LIST__ = (func_ptr) (-1)
+#define DTOR_LIST_BEGIN \
+func_ptr __DTOR_LIST__ __attribute__((section(DTORS_SECTION_NAME))) = \
+ (func_ptr) (-1)
-#define DTOR_LIST_END \
-asm (DTORS_SECTION_ASM_OP); \
-func_ptr __DTOR_END__ = (func_ptr) 0
+#define DTOR_LIST_END \
+func_ptr __DTOR_END__ __attribute__((section(DTORS_SECTION_NAME))) = \
+ (func_ptr) 0
/* Don't set the target flags, this is done by the linker script */
#undef LIB_SPEC
diff --git a/gcc/config/mips/elf64.h b/gcc/config/mips/elf64.h
index 8829758..b6015f5 100644
--- a/gcc/config/mips/elf64.h
+++ b/gcc/config/mips/elf64.h
@@ -256,7 +256,8 @@ do { \
/* Support the ctors/dtors and other sections. */
-/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+/* Define the names of and pseudo-ops used to switch to the .ctors and
+ .dtors sections.
Note that we want to give these sections the SHF_WRITE attribute
because these sections will actually contain data (i.e. tables of
@@ -271,7 +272,9 @@ do { \
errors unless the .ctors and .dtors sections are marked as writable
via the SHF_WRITE attribute.) */
+#define CTORS_SECTION_NAME ".ctors"
#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"aw\""
+#define DTORS_SECTION_NAME ".dtors"
#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"aw\""
/* There's no point providing a default definition of __CTOR_LIST__
@@ -325,21 +328,21 @@ void FN () \
fprintf (FILE, "\n"); \
} while (0)
-#define CTOR_LIST_BEGIN \
-asm (CTORS_SECTION_ASM_OP); \
-func_ptr __CTOR_LIST__ = (func_ptr) (-1)
+#define CTOR_LIST_BEGIN \
+func_ptr __CTOR_LIST__ __attribute__((section(CTORS_SECTION_NAME))) = \
+ (func_ptr) (-1)
-#define CTOR_LIST_END \
-asm (CTORS_SECTION_ASM_OP); \
-func_ptr __CTOR_END__ = (func_ptr) 0
+#define CTOR_LIST_END \
+func_ptr __CTOR_END__ __attribute__((section(CTORS_SECTION_NAME))) = \
+ (func_ptr) 0
-#define DTOR_LIST_BEGIN \
-asm (DTORS_SECTION_ASM_OP); \
-func_ptr __DTOR_LIST__ = (func_ptr) (-1)
+#define DTOR_LIST_BEGIN \
+func_ptr __DTOR_LIST__ __attribute__((section(DTORS_SECTION_NAME))) = \
+ (func_ptr) (-1)
-#define DTOR_LIST_END \
-asm (DTORS_SECTION_ASM_OP); \
-func_ptr __DTOR_END__ = (func_ptr) 0
+#define DTOR_LIST_END \
+func_ptr __DTOR_END__ __attribute__((section(DTORS_SECTION_NAME))) = \
+ (func_ptr) 0
/* Don't set the target flags, this is done by the linker script */
#undef LIB_SPEC