diff options
author | Richard Henderson <rth@redhat.com> | 2001-08-09 15:33:35 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-08-09 15:33:35 -0700 |
commit | 2cc07db4b089b8b3df05261f1d7acbc96d2e720a (patch) | |
tree | ddb2d5519f49bc33648c25225b8b8ba84df590b9 /gcc/config/arm/elf.h | |
parent | ef8d8b8922a034dfac5cff9d5fa781dc57c49ed0 (diff) | |
download | gcc-2cc07db4b089b8b3df05261f1d7acbc96d2e720a.zip gcc-2cc07db4b089b8b3df05261f1d7acbc96d2e720a.tar.gz gcc-2cc07db4b089b8b3df05261f1d7acbc96d2e720a.tar.bz2 |
Move constructor/destructor handling into target hooks.
From-SVN: r44747
Diffstat (limited to 'gcc/config/arm/elf.h')
-rw-r--r-- | gcc/config/arm/elf.h | 84 |
1 files changed, 2 insertions, 82 deletions
diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h index 102b53a..0c8cd03 100644 --- a/gcc/config/arm/elf.h +++ b/gcc/config/arm/elf.h @@ -227,30 +227,6 @@ Boston, MA 02111-1307, USA. */ while (0) #endif -/* Support the ctors/dtors and other sections. */ - -/* Define the 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 - addresses of functions in the current root executable or shared library - file) and, in the case of a shared library, the relocatable addresses - will have to be properly resolved/relocated (and then written into) by - the dynamic linker when it actually attaches the given shared library - to the executing process. (Note that on SVR4, you may wish to use the - `-z text' option to the ELF linker, when building a shared library, as - an additional check that you are doing everything right. But if you do - use the `-z text' option when building a shared library, you will get - errors unless the .ctors and .dtors sections are marked as writable - via the SHF_WRITE attribute.) */ -#ifndef CTORS_SECTION_ASM_OP -#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"aw\"" -#endif - -#ifndef DTORS_SECTION_ASM_OP -#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"aw\"" -#endif - /* A list of other sections which the compiler might be "in" at any given time. */ #ifndef SUBTARGET_EXTRA_SECTIONS @@ -258,7 +234,7 @@ Boston, MA 02111-1307, USA. */ #endif #ifndef EXTRA_SECTIONS -#define EXTRA_SECTIONS SUBTARGET_EXTRA_SECTIONS in_ctors, in_dtors +#define EXTRA_SECTIONS SUBTARGET_EXTRA_SECTIONS #endif /* A list of extra section function definitions. */ @@ -268,35 +244,7 @@ Boston, MA 02111-1307, USA. */ #ifndef EXTRA_SECTION_FUNCTIONS #define EXTRA_SECTION_FUNCTIONS \ - SUBTARGET_EXTRA_SECTION_FUNCTIONS \ - CTORS_SECTION_FUNCTION \ - DTORS_SECTION_FUNCTION -#endif - -#ifndef CTORS_SECTION_FUNCTION -#define CTORS_SECTION_FUNCTION \ -void \ -ctors_section () \ -{ \ - if (in_section != in_ctors) \ - { \ - fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \ - in_section = in_ctors; \ - } \ -} -#endif - -#ifndef DTORS_SECTION_FUNCTION -#define DTORS_SECTION_FUNCTION \ -void \ -dtors_section () \ -{ \ - if (in_section != in_dtors) \ - { \ - fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \ - in_section = in_dtors; \ - } \ -} + SUBTARGET_EXTRA_SECTION_FUNCTIONS #endif /* Switch into a generic section. */ @@ -308,34 +256,6 @@ dtors_section () \ #define INT_ASM_OP "\t.word\t" #endif -/* A C statement (sans semicolon) to output an element in the table of - global constructors. */ -#ifndef ASM_OUTPUT_CONSTRUCTOR -#define ASM_OUTPUT_CONSTRUCTOR(STREAM, NAME) \ - do \ - { \ - ctors_section (); \ - fprintf (STREAM, "%s", INT_ASM_OP); \ - assemble_name (STREAM, NAME); \ - fprintf (STREAM, "\n"); \ - } \ - while (0) -#endif - -/* A C statement (sans semicolon) to output an element in the table of - global destructors. */ -#ifndef ASM_OUTPUT_DESTRUCTOR -#define ASM_OUTPUT_DESTRUCTOR(STREAM, NAME) \ - do \ - { \ - dtors_section (); \ - fprintf (STREAM, "%s", INT_ASM_OP); \ - assemble_name (STREAM, NAME); \ - fprintf (STREAM, "\n"); \ - } \ - while (0) -#endif - /* This is how we tell the assembler that a symbol is weak. */ #define ASM_WEAKEN_LABEL(FILE, NAME) \ |