aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2002-03-04 20:41:55 +0000
committerH.J. Lu <hjl.tools@gmail.com>2002-03-04 20:41:55 +0000
commit25e2787005c2139fd4d92b1c78ce170da77c1672 (patch)
tree133a6d0a7d55bbdde50dfe70a8a5368ca5c0cab8 /bfd/elf.c
parente9682144c14fc809af72bd6c0b8c69731d38679c (diff)
downloadgdb-25e2787005c2139fd4d92b1c78ce170da77c1672.zip
gdb-25e2787005c2139fd4d92b1c78ce170da77c1672.tar.gz
gdb-25e2787005c2139fd4d92b1c78ce170da77c1672.tar.bz2
2002-03-04 H.J. Lu <hjl@gnu.org>
* elf.c (bfd_section_from_shdr): Handle special sections, .init_array, .fini_array and .preinit_array. (elf_fake_sections): Likewise. * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the DT entry only if the section is in output for .init_array, .fini_array and .preinit_array. Complain about .preinit_array section in DSO. (elf_bfd_final_link): Warn zero size for .init_array, .fini_array and .preinit_array sections. * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY. (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and .preinit_array.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 7f63b34..5221f72 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1563,6 +1563,9 @@ bfd_section_from_shdr (abfd, shindex)
case SHT_NOBITS: /* .bss section. */
case SHT_HASH: /* .hash section. */
case SHT_NOTE: /* .note section. */
+ case SHT_INIT_ARRAY: /* .init_array section. */
+ case SHT_FINI_ARRAY: /* .fini_array section. */
+ case SHT_PREINIT_ARRAY: /* .preinit_array section. */
return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
case SHT_SYMTAB: /* A symbol table */
@@ -2177,6 +2180,12 @@ elf_fake_sections (abfd, asect, failedptrarg)
this_hdr->sh_type = SHT_REL;
this_hdr->sh_entsize = bed->s->sizeof_rel;
}
+ else if (strcmp (asect->name, ".init_array") == 0)
+ this_hdr->sh_type = SHT_INIT_ARRAY;
+ else if (strcmp (asect->name, ".fini_array") == 0)
+ this_hdr->sh_type = SHT_FINI_ARRAY;
+ else if (strcmp (asect->name, ".preinit_array") == 0)
+ this_hdr->sh_type = SHT_PREINIT_ARRAY;
else if (strncmp (asect->name, ".note", 5) == 0)
this_hdr->sh_type = SHT_NOTE;
else if (strncmp (asect->name, ".stab", 5) == 0