summaryrefslogtreecommitdiff
path: root/gcc/config/mips/elf.h
diff options
context:
space:
mode:
authorechristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-28 23:03:52 +0000
committerechristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-28 23:03:52 +0000
commitb7fdac4b9da9acfae4daa1ceff19d65e68443fe0 (patch)
tree490b4a7728416582f147cb5193c5b68562a77802 /gcc/config/mips/elf.h
parentb0382a8ecda8fa7089670a8d1cf0cf02cc5d2055 (diff)
downloadgcc-b7fdac4b9da9acfae4daa1ceff19d65e68443fe0.tar.gz
2001-08-28 Eric Christopher <echristo@redhat.com>
Richard Henderson <rth@redhat.com> * c-pragma.h (add_weak): Move prototype from here... * output.h (add_weak): ... to here. * varasm.c (add_weak): Fix typo. * config/mips/crti.asm: New file. * config/mips/crtn.asm: Ditto. * config/mips/elf.h (SBSS_SECTION_ASM_OP) Add #undef. (CTOR_LISTS_DEFINED_EXTERNALLY): Remove. (INVOKE__main): Ditto. (INIT_SECTION_ASM_OP): New. (FINI_SECTION_ASM_OP): Ditto. (STARTFILE_SPEC): Add crti. (ENDFILE_SPEC): Add crtn. * config/mips/elf64.h: Same. * config/mips/rtems64.h (INVOKE__main, NAME__MAIN, SYMBOL__MAIN): Remove. * config/mips/vxworks.h: Ditto. * config/mips/t-elf: Support crti and crtn. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45243 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mips/elf.h')
-rw-r--r--gcc/config/mips/elf.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/gcc/config/mips/elf.h b/gcc/config/mips/elf.h
index 4b2e605d8ed..c7e68f1687f 100644
--- a/gcc/config/mips/elf.h
+++ b/gcc/config/mips/elf.h
@@ -99,10 +99,12 @@ do { \
uninitialized global data will be output in the data section if
`-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
used. */
+
#ifndef BSS_SECTION_ASM_OP
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
#endif
+#undef SBSS_SECTION_ASM_OP
#define SBSS_SECTION_ASM_OP "\t.section .sbss"
/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
@@ -213,17 +215,10 @@ do { \
#define UNIQUE_SECTION(DECL,RELOC) \
mips_unique_section ((DECL), (RELOC))
-/* There's no point providing a default definition of __CTOR_LIST__
- since people are expected either to use crtbegin.o, or an equivalent,
- or provide their own definition. */
-#define CTOR_LISTS_DEFINED_EXTERNALLY
-
/* A list of other sections which the compiler might be "in" at any
given time. */
#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_sdata, in_sbss, in_rdata
-
-#define INVOKE__main
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
@@ -241,12 +236,23 @@ void FN () \
} \
}
+/* On elf, we *do* have support for the .init and .fini sections, and we
+ can put stuff in there to be executed before and after `main'. We let
+ crtstuff.c and other files know this by defining the following symbols.
+ The definitions say how to change sections to the .init and .fini
+ sections. This is the same for all known elf assemblers. */
+
+#undef INIT_SECTION_ASM_OP
+#define INIT_SECTION_ASM_OP "\t.section\t.init"
+#undef FINI_SECTION_ASM_OP
+#define FINI_SECTION_ASM_OP "\t.section\t.fini"
+
/* Don't set the target flags, this is done by the linker script */
#undef LIB_SPEC
#define LIB_SPEC ""
#undef STARTFILE_SPEC
-#define STARTFILE_SPEC "crtbegin%O%s %{!mno-crt0:crt0%O%s}"
+#define STARTFILE_SPEC "crti%O%s crtbegin%O%s %{!mno-crt0:crt0%O%s}"
#undef ENDFILE_SPEC
-#define ENDFILE_SPEC "crtend%O%s"
+#define ENDFILE_SPEC "crtend%O%s crtn%O%s"