diff options
author | Jan Beulich <jbeulich@novell.com> | 2006-12-04 08:57:09 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@novell.com> | 2006-12-04 08:57:09 +0000 |
commit | eb3d5f3b94495740ddeedc7282baaa2b79de99cd (patch) | |
tree | 98d6cc69095979c67955ffdec6505554845b25d4 /ld/emultempl | |
parent | d807a492c6640cad84bfba13c2266747b407b521 (diff) | |
download | gdb-eb3d5f3b94495740ddeedc7282baaa2b79de99cd.zip gdb-eb3d5f3b94495740ddeedc7282baaa2b79de99cd.tar.gz gdb-eb3d5f3b94495740ddeedc7282baaa2b79de99cd.tar.bz2 |
bfd/
2006-12-04 Jan Beulich <jbeulich@novell.com>
* elflink.c (_bfd_elf_link_create_dynamic_sections): Don't create
.eh_frame_hdr section from here anymore.
(bfd_elf_size_dynamic_sections): Call _bfd_elf_maybe_strip_eh_frame_hdr
a little earlier.
ld/
2006-12-04 Jan Beulich <jbeulich@novell.com>
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Create
.eh_frame_hdr section here.
ld/testsuite/
2006-12-04 Jan Beulich <jbeulich@novell.com>
* ld-elf/eh-frame-hdr.d: New.
* ld-elf/eh-frame-hdr.s: New.
* ld-ia64/tlsbin.dd, ld-ia64/tlsbin.sd: Don't depend on exact linkage
table layout.
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/elf32.em | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index 03d9d8d..2888008 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -865,6 +865,42 @@ gld${EMULATION_NAME}_after_open (void) { struct bfd_link_needed_list *needed, *l; + if (link_info.eh_frame_hdr + && ! link_info.traditional_format + && ! link_info.relocatable) + { + struct elf_link_hash_table *htab; + + htab = elf_hash_table (&link_info); + if (is_elf_hash_table (htab)) + { + bfd *abfd; + asection *s; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next) + { + s = bfd_get_section_by_name (abfd, ".eh_frame"); + if (s && s->size > 8 && !bfd_is_abs_section (s->output_section)) + break; + } + if (abfd) + { + const struct elf_backend_data *bed; + + bed = get_elf_backend_data (abfd); + s = bfd_make_section_with_flags (abfd, ".eh_frame_hdr", + bed->dynamic_sec_flags + | SEC_READONLY); + if (s != NULL + && bfd_set_section_alignment (abfd, s, 2)) + htab->eh_info.hdr_sec = s; + else + einfo ("%P: warning: Cannot create .eh_frame_hdr section," + " --eh-frame-hdr ignored.\n"); + } + } + } + /* We only need to worry about this when doing a final link. */ if (link_info.relocatable || !link_info.executable) return; |