summaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2007-12-15 09:33:51 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2007-12-15 09:33:51 +0000
commitf873e4cc98d87684b308b0a601874c2324c5b372 (patch)
treeb5c620f44c295fd7e3c9452444347c5dbae18f98 /bfd/elflink.c
parent35510eaa8cec87c16e51c1208bbb451d044a076a (diff)
downloadgdb-f873e4cc98d87684b308b0a601874c2324c5b372.tar.gz
bfd/
* elf-bfd.h (eh_cie_fde): Add u.cie. Document how u.fde.cie_inf changes when removed == 0. (eh_frame_hdr_info): Add parsed_eh_frames. (_bfd_elf_begin_eh_frame_parsing): Declare. (_bfd_elf_parse_eh_frame): Declare. (_bfd_elf_end_eh_frame_parsing): Declare. * elf-eh-frame.c (_bfd_elf_begin_eh_frame_parsing): New function. (_bfd_elf_parse_eh_frame): New function, split out from _bfd_elf_discard_section_eh_frame. Make a first pass through the buffer to calculate the number of entries and CIEs. Allocate memory for them before the main loop. Replace current extended cie representation with a pair of pointers, one to the local eh_cie_fde and one to the full struct cie. Allocate a separate array of struct cies if not merging. Merge CIEs during the main loop and set up each u.cie.merged field. Point an FDE's cie_inf field directly at the local CIE. Initially assume that all entries should be removed. (_bfd_elf_end_eh_frame_parsing): New function. (_bfd_elf_discard_section_eh_frame): Assume that the section has already been parsed. Use a separate pass to mark entries that need to be kept. Use the u.cie.merged field to track a CIE's group representative. * elflink.c (bfd_elf_discard_info): Call _bfd_elf_parse_eh_frame before _bfd_elf_discard_section_eh_frame. Wrap loop with calls to _bfd_elf_begin_eh_frame_parsing and _bfd_elf_end_eh_frame_parsing.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index a73f6c897c9..4201e2865b0 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -11894,6 +11894,7 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
|| !is_elf_hash_table (info->hash))
return FALSE;
+ _bfd_elf_begin_eh_frame_parsing (info);
for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next)
{
if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
@@ -11944,6 +11945,7 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
if (eh != NULL
&& init_reloc_cookie_rels (&cookie, info, abfd, eh))
{
+ _bfd_elf_parse_eh_frame (abfd, info, eh, &cookie);
if (_bfd_elf_discard_section_eh_frame (abfd, info, eh,
bfd_elf_reloc_symbol_deleted_p,
&cookie))
@@ -11957,6 +11959,7 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
fini_reloc_cookie (&cookie, abfd);
}
+ _bfd_elf_end_eh_frame_parsing (info);
if (info->eh_frame_hdr
&& !info->relocatable