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/elf.c | |
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/elf.c')
-rw-r--r-- | bfd/elf.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -3449,10 +3449,9 @@ map_sections_to_segments (abfd) /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME segment. */ - eh_frame_hdr = NULL; - if (elf_tdata (abfd)->eh_frame_hdr) - eh_frame_hdr = bfd_get_section_by_name (abfd, ".eh_frame_hdr"); - if (eh_frame_hdr != NULL && (eh_frame_hdr->flags & SEC_LOAD)) + eh_frame_hdr = elf_tdata (abfd)->eh_frame_hdr; + if (eh_frame_hdr != NULL + && (eh_frame_hdr->output_section->flags & SEC_LOAD) != 0) { amt = sizeof (struct elf_segment_map); m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); @@ -3461,7 +3460,7 @@ map_sections_to_segments (abfd) m->next = NULL; m->p_type = PT_GNU_EH_FRAME; m->count = 1; - m->sections[0] = eh_frame_hdr; + m->sections[0] = eh_frame_hdr->output_section; *pm = m; pm = &m->next; @@ -4032,8 +4031,7 @@ get_program_header_size (abfd) ++segs; } - if (elf_tdata (abfd)->eh_frame_hdr - && bfd_get_section_by_name (abfd, ".eh_frame_hdr") != NULL) + if (elf_tdata (abfd)->eh_frame_hdr) { /* We need a PT_GNU_EH_FRAME segment. */ ++segs; @@ -7327,9 +7325,9 @@ _bfd_elf_section_offset (abfd, info, sec, offset) switch (sec_data->sec_info_type) { case ELF_INFO_TYPE_STABS: - return _bfd_stab_section_offset - (abfd, &elf_hash_table (info)->merge_info, sec, &sec_data->sec_info, - offset); + return _bfd_stab_section_offset (abfd, + &elf_hash_table (info)->merge_info, + sec, &sec_data->sec_info, offset); case ELF_INFO_TYPE_EH_FRAME: return _bfd_elf_eh_frame_section_offset (abfd, sec, offset); default: |