aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2008-01-09 09:36:11 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2008-01-09 09:36:11 +0000
commit184d07da89afd7b64fedf2360e9412f3f221b5f8 (patch)
tree86d884295ea4540e85611148f03072cca17887ae /bfd/elf-bfd.h
parent137033e97482d340139b1499c6db4236f35c8577 (diff)
downloadgdb-184d07da89afd7b64fedf2360e9412f3f221b5f8.zip
gdb-184d07da89afd7b64fedf2360e9412f3f221b5f8.tar.gz
gdb-184d07da89afd7b64fedf2360e9412f3f221b5f8.tar.bz2
bfd/
PR ld/5526 * elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged fields. Rename u.cie.u.merged to u.cie.u.merged_with. (eh_frame_sec_info): Add a cies field. (eh_frame_hdr_info): Add a merge_cies field. * elf-eh-frame.c (cie): Add a reloc_index member to the personality union. (_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead of hdr_info->cies. (_bfd_elf_parse_eh_frame): Remove tmp_cie. Ccreate an array of cie structures in all cases and use it instead of extended_cies. If merging, store the cie array in sec_info->cies and point each CIE's eh_fde_cie at the associated element. Do not try to calculate the value of the personality routine here; record the offset of the relocation instead. Do not merge CIEs here. (_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here... (_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead. (_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE. (find_merged_cie): New function. (_bfd_elf_gc_mark_fdes): Use it. Free sec_info->cies. ld/testsuite/ PR ld/5526 * ld-elf/eh6.s, ld-elf/eh6.d: New test.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index dc9f153..86ddd63 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -276,19 +276,20 @@ struct eh_cie_fde
struct eh_cie_fde *next_for_section;
} fde;
struct {
- /* In general, equivalent CIEs are grouped together, with one CIE
- representing all the others in a group.
+ /* CIEs have three states:
- If REMOVED == 0, this CIE is the group representative, and
- U.SEC points to the .eh_frame section that contains the CIE.
+ - REMOVED && !MERGED: Slated for removal because we haven't yet
+ proven that an FDE needs it. FULL_CIE, if nonnull, points to
+ more detailed information about the CIE.
- If REMOVED == 1, this CIE is the group representative if
- U.MERGED is a self pointer. Otherwise, following U.MERGED
- brings us "closer" to the CIE's group representative;
- if U.MERGED is not the group representative, then
- U.MERGED->U.MERGED is. */
+ - REMOVED && MERGED: We have merged this CIE with MERGED_WITH,
+ which may not belong to the same input section.
+
+ - !REMOVED: We have decided to keep this CIE. SEC is the
+ .eh_frame input section that contains the CIE. */
union {
- struct eh_cie_fde *merged;
+ struct cie *full_cie;
+ struct eh_cie_fde *merged_with;
asection *sec;
} u;
@@ -296,8 +297,7 @@ struct eh_cie_fde
unsigned int gc_mark : 1;
/* True if we have decided to turn an absolute LSDA encoding into
- a PC-relative one. It is the group representative's setting
- that matters. */
+ a PC-relative one. */
unsigned int make_lsda_relative : 1;
/* True if the CIE contains personality data and if that data
@@ -307,6 +307,9 @@ struct eh_cie_fde
/* True if we need to add an 'R' (FDE encoding) entry to the
CIE's augmentation data. */
unsigned int add_fde_encoding : 1;
+
+ /* True if we have merged this CIE with another. */
+ unsigned int merged : 1;
} cie;
} u;
unsigned int reloc_index;
@@ -341,6 +344,7 @@ struct eh_cie_fde
struct eh_frame_sec_info
{
unsigned int count;
+ struct cie *cies;
struct eh_cie_fde entry[1];
};
@@ -358,6 +362,8 @@ struct eh_frame_hdr_info
asection *hdr_sec;
unsigned int fde_count, array_count;
struct eh_frame_array_ent *array;
+ /* TRUE if we should try to merge CIEs between input sections. */
+ bfd_boolean merge_cies;
/* TRUE if all .eh_frames have been parsd. */
bfd_boolean parsed_eh_frames;
/* TRUE if .eh_frame_hdr should contain the sorted search table.