diff options
author | Alan Modra <amodra@gmail.com> | 2002-11-12 07:35:26 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-11-12 07:35:26 +0000 |
commit | 126495ed15554a735f74a9414c2e417f9b2de4c2 (patch) | |
tree | 75ba480040b7edb68f1c829fde82b1b0734c02b9 /bfd/elflink.h | |
parent | 99eb2ac83dc99f32cf4eec92071756c3aaf6582c (diff) | |
download | gdb-126495ed15554a735f74a9414c2e417f9b2de4c2.zip gdb-126495ed15554a735f74a9414c2e417f9b2de4c2.tar.gz gdb-126495ed15554a735f74a9414c2e417f9b2de4c2.tar.bz2 |
* elf-bfd.h (struct cie_header): Move from elf_eh-frame.c.
(struct cie, struct eh_cie_fde, struct eh_frame_sec_info): Likewise.
(struct eh_frame_array_ent, struct eh_frame_hdr_info): Likewise.
(enum elf_link_info_type): Remove ELF_INFO_TYPE_EH_FRAME_HDR.
(struct eh_frame_hdr_info): Add "hdr_sec", remove "split".
(struct elf_link_hash_table): Add eh_info.
(struct elf_obj_tdata): Change eh_frame_hdr to an asection *.
(_bfd_elf_discard_section_eh_frame): Update prototype.
(_bfd_elf_discard_section_eh_frame_hdr): Likewise.
(_bfd_elf_write_section_eh_frame): Likewise.
(_bfd_elf_write_section_eh_frame_hdr): Likewise.
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Remove "ehdrsec"
param. Get "hdr_info" from link hash table.
(_bfd_elf_discard_section_eh_frame_hdr): Remove "sec" param. Get
header section from link hash table. Save header section to elf_tdata.
(_bfd_elf_maybe_strip_eh_frame_hdr): Remove local "sec". Use
header section from link hash table. Don't alloc hdr_info. Clear
hdr_sec instead of setting "strip".
(_bfd_elf_eh_frame_section_offset): Formatting.
(_bfd_elf_write_section_eh_frame): Remove "ehdrsec", add "info" param.
Get header section from link hash table.
(_bfd_elf_write_section_eh_frame_hdr): Remove "sec", add "info" param.
Get header section from link hash table.
* elf.c (map_sections_to_segments): Use cached eh_frame_hdr.
(get_program_header_size): Likewise.
(_bfd_elf_section_offset): Formatting.
* elflink.h (elf_link_create_dynamic_sections): Stash eh frame header
section pointer in link hash table.
(elf_bfd_final_link): Adjust _bfd_elf_write_section_eh_frame_hdr
and _bfd_elf_write_section_eh_frame calls. Update comment about
eh_frame entries.
(elf_bfd_discard_info): Adjust _bfd_elf_discard_section_eh_frame and
_bfd_elf_discard_section_eh_frame_hdr calls. Remove "ehdr".
* po/SRC-POTFILES.in: Regenerate.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 61 |
1 files changed, 18 insertions, 43 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index 339cc23..0f59fec 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -2342,6 +2342,7 @@ elf_link_create_dynamic_sections (abfd, info) || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) return false; + elf_hash_table (info)->eh_info.hdr_sec = s; } /* Create sections to hold version informations. These are removed @@ -5854,17 +5855,10 @@ elf_bfd_final_link (abfd, info) goto error_return; } - if (info->eh_frame_hdr && elf_hash_table (info)->dynobj) + if (info->eh_frame_hdr) { - o = bfd_get_section_by_name (elf_hash_table (info)->dynobj, - ".eh_frame_hdr"); - if (o - && (elf_section_data (o)->sec_info_type - == ELF_INFO_TYPE_EH_FRAME_HDR)) - { - if (! _bfd_elf_write_section_eh_frame_hdr (abfd, o)) - goto error_return; - } + if (! _bfd_elf_write_section_eh_frame_hdr (abfd, info)) + goto error_return; } if (finfo.symstrtab != NULL) @@ -6839,12 +6833,7 @@ elf_link_input_bfd (finfo, input_bfd) from discarded sections and section symbols from removed link-once sections. Complain about relocs against discarded sections. Zero relocs against removed - link-once sections. We should really complain if - anything in the final link tries to use it, but - DWARF-based exception handling might have an entry in - .eh_frame to describe a routine in the linkonce section, - and it turns out to be hard to remove the .eh_frame - entry too. FIXME. */ + link-once sections. */ if (!finfo->info->relocateable && !elf_section_ignore_discarded_relocs (o)) { @@ -7166,19 +7155,14 @@ elf_link_input_bfd (finfo, input_bfd) return false; break; case ELF_INFO_TYPE_MERGE: - if (! (_bfd_write_merged_section - (output_bfd, o, elf_section_data (o)->sec_info))) + if (! _bfd_write_merged_section (output_bfd, o, + elf_section_data (o)->sec_info)) return false; break; case ELF_INFO_TYPE_EH_FRAME: { - asection *ehdrsec; - - ehdrsec - = bfd_get_section_by_name (elf_hash_table (finfo->info)->dynobj, - ".eh_frame_hdr"); - if (! (_bfd_elf_write_section_eh_frame (output_bfd, o, ehdrsec, - contents))) + if (! _bfd_elf_write_section_eh_frame (output_bfd, finfo->info, + o, contents)) return false; } break; @@ -8409,7 +8393,7 @@ elf_bfd_discard_info (output_bfd, info) struct bfd_link_info *info; { struct elf_reloc_cookie cookie; - asection *stab, *eh, *ehdr; + asection *stab, *eh; Elf_Internal_Shdr *symtab_hdr; struct elf_backend_data *bed; bfd *abfd; @@ -8422,11 +8406,6 @@ elf_bfd_discard_info (output_bfd, info) || ! is_elf_hash_table (info)) return false; - ehdr = NULL; - if (elf_hash_table (info)->dynobj != NULL) - ehdr = bfd_get_section_by_name (elf_hash_table (info)->dynobj, - ".eh_frame_hdr"); - for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) { if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) @@ -8437,15 +8416,11 @@ elf_bfd_discard_info (output_bfd, info) if ((abfd->flags & DYNAMIC) != 0) continue; - eh = NULL; - if (ehdr != NULL) - { - eh = bfd_get_section_by_name (abfd, ".eh_frame"); - if (eh != NULL - && (eh->_raw_size == 0 - || bfd_is_abs_section (eh->output_section))) - eh = NULL; - } + eh = bfd_get_section_by_name (abfd, ".eh_frame"); + if (eh != NULL + && (eh->_raw_size == 0 + || bfd_is_abs_section (eh->output_section))) + eh = NULL; stab = bfd_get_section_by_name (abfd, ".stab"); if (stab != NULL @@ -8520,7 +8495,7 @@ elf_bfd_discard_info (output_bfd, info) if (cookie.rels != NULL) cookie.relend += count * bed->s->int_rels_per_ext_rel; - if (_bfd_elf_discard_section_eh_frame (abfd, info, eh, ehdr, + if (_bfd_elf_discard_section_eh_frame (abfd, info, eh, elf_reloc_symbol_deleted_p, &cookie)) ret = true; @@ -8544,8 +8519,8 @@ elf_bfd_discard_info (output_bfd, info) } } - if (ehdr != NULL - && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info, ehdr)) + if (info->eh_frame_hdr + && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info)) ret = true; return ret; |