diff options
author | Alan Modra <amodra@gmail.com> | 2014-04-30 10:11:56 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-04-30 10:11:56 +0930 |
commit | 5087d529319fc6d5985032183c138dd715d707b3 (patch) | |
tree | b4b445a47d7c2f312d08a8dd879acd96b36a329a /bfd/elf-eh-frame.c | |
parent | 264bddaff16ce11038fa8e40068ec7535a3a7f3c (diff) | |
download | gdb-5087d529319fc6d5985032183c138dd715d707b3.zip gdb-5087d529319fc6d5985032183c138dd715d707b3.tar.gz gdb-5087d529319fc6d5985032183c138dd715d707b3.tar.bz2 |
Don't use vma to identify eh_frame personality function
This is all we should need to be able to run the eh_frame parts of
bfd_elf_discard_info before bfd_elf_size_dynamic_sections
* elf-eh-frame.c (struct cie.personality): Replace val with sym.
(find_merged_cie): Identify personality functions by (bfd_id,index)
pair when a local sym is used.
Diffstat (limited to 'bfd/elf-eh-frame.c')
-rw-r--r-- | bfd/elf-eh-frame.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 8c3712f..0f0a563 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -40,7 +40,10 @@ struct cie bfd_vma augmentation_size; union { struct elf_link_hash_entry *h; - bfd_vma val; + struct { + unsigned int bfd_id; + unsigned int index; + } sym; unsigned int reloc_index; } personality; asection *output_sec; @@ -1030,8 +1033,12 @@ find_merged_cie (bfd *abfd, struct bfd_link_info *info, asection *sec, { bfd_boolean per_binds_local; - /* Work out the address of personality routine, either as an absolute - value or as a symbol. */ + /* Work out the address of personality routine, or at least + enough info that we could calculate the address had we made a + final section layout. The symbol on the reloc is enough, + either the hash for a global, or (bfd id, index) pair for a + local. The assumption here is that no one uses addends on + the reloc. */ rel = cookie->rels + cie->personality.reloc_index; memset (&cie->personality, 0, sizeof (cie->personality)); #ifdef BFD64 @@ -1071,9 +1078,8 @@ find_merged_cie (bfd *abfd, struct bfd_link_info *info, asection *sec, return cie_inf; cie->local_personality = 1; - cie->personality.val = (sym->st_value - + sym_sec->output_offset - + sym_sec->output_section->vma); + cie->personality.sym.bfd_id = abfd->id; + cie->personality.sym.index = r_symndx; per_binds_local = TRUE; } |