From 10b016c223f165a06dbd20e46307c9a0bfbf0ee2 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Wed, 8 Sep 2004 20:52:49 +0000 Subject: [PATCH] * config/obj-elf.c (obj_elf_section_type): Handle init_array, fini_array and preinit_array section types. * config/tc-ia64.c (ia64_elf_section_type): Remove init_array and fini_array. * doc/as.texinfo: Document extra section types. --- gas/ChangeLog | 8 ++++++++ gas/config/obj-elf.c | 6 ++++++ gas/config/tc-ia64.c | 6 ------ gas/doc/as.texinfo | 8 ++++++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 13d53fd5ff6..dcfe99b9498 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2004-09-08 Paul Brook + + * config/obj-elf.c (obj_elf_section_type): Handle init_array, + fini_array and preinit_array section types. + * config/tc-ia64.c (ia64_elf_section_type): Remove init_array + and fini_array. + * doc/as.texinfo: Document extra section types. + 2004-09-02 Mark Mitchell * Makefile.am (TARG_ENV_HFILES): Add te-symbian.h. diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 94f53b1c944..84f5a84a2b3 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -771,6 +771,12 @@ obj_elf_section_type (char *str, size_t len) return SHT_NOBITS; if (len == 4 && strncmp (str, "note", 4) == 0) return SHT_NOTE; + if (len == 10 && strncmp (str, "init_array", 10) == 0) + return SHT_INIT_ARRAY; + if (len == 10 && strncmp (str, "fini_array", 10) == 0) + return SHT_FINI_ARRAY; + if (len == 13 && strncmp (str, "preinit_array", 13) == 0) + return SHT_PREINIT_ARRAY; #ifdef md_elf_section_type { diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index 1d43e7773f4..b2e599f6c97 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -996,12 +996,6 @@ ia64_elf_section_type (str, len) if (STREQ ("unwind")) return SHT_IA_64_UNWIND; - if (STREQ ("init_array")) - return SHT_INIT_ARRAY; - - if (STREQ ("fini_array")) - return SHT_FINI_ARRAY; - return -1; #undef STREQ } diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo index 89868c290f1..23de55fefa9 100644 --- a/gas/doc/as.texinfo +++ b/gas/doc/as.texinfo @@ -5291,8 +5291,16 @@ section contains data section does not contain data (i.e., section only occupies space) @item @@note section contains data which is used by things other than the program +@item @@init_array +section contains an array of pointers to init functions +@item @@fini_array +section contains an array of pointers to finish functions +@item @@preinit_array +section contains an array of pointers to pre-init functions @end table +Many targets only support the first three section types. + Note on targets where the @code{@@} character is the start of a comment (eg ARM) then another character is used instead. For example the ARM port uses the @code{%} character. -- 2.30.2