summaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-10-04 15:53:58 +0930
committerAlan Modra <amodra@gmail.com>2014-10-04 22:49:32 +0930
commitc2aaac080c05369f6fb7009d85dcf9bb98a914e6 (patch)
tree2e32622b910a96f7831f1aaa73f590c3878653ac /bfd/elf-bfd.h
parent0661ae8e4d4a2cadcf04f8300540a723746cba6d (diff)
Discard zero address range eh_frame FDEs
These are useless because they can't match any address. In fact, worse than useless because the .eh_frame_hdr lookup table matching addresses to FDEs does not contain information about the FDE range. The table is sorted by address; Range is inferred by the address delta from one entry to the next. So if a zero address range FDE is followed by a normal non-zero range FDE for the same address, everything is good. However, the qsort could just as easily sort the FDEs in the other order, in which case the normal FDE would effectively be seen to have a zero range. bfd/ PR 17447 * elf-bfd.h (struct eh_cie_fde): Comment re NULL u.fde.cie_inf. * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Mark zero address range FDEs for discarding. (vma_compare): Sort on range after address. (_bfd_elf_gc_mark_fdes): Test for NULL u.fde.cie_inf. (_bfd_elf_discard_section_eh_frame): Likewise. Write "FDE" in error message rather than "fde". (_bfd_elf_write_section_eh_frame_hdr): Write "PC" and "FDE" in error message. ld/testsuite/ * ld-elf/eh1.s: Don't create FDEs with zero address ranges. * ld-elf/eh3.s: Likewise. * ld-elf/eh1.d, * ld-elf/eh2.d, * ld-elf/eh3.d: Adjust. * ld-mips-elf/eh-frame1-n32.d: Warning match update. * ld-mips-elf/eh-frame1-n64.d: Likewise. * ld-mips-elf/eh-frame2-n32.d: Likewise. * ld-mips-elf/eh-frame2-n64.d: Likewise.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index dc343ece47..b2feee3b14 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -280,7 +280,9 @@ struct eh_cie_fde
If REMOVED == 0, this is the CIE that we have chosen to use for
the output FDE. The CIE's REMOVED field is also 0, but the CIE
- might belong to a different .eh_frame input section from the FDE. */
+ might belong to a different .eh_frame input section from the FDE.
+
+ May be NULL to signify that the FDE should be discarded. */
struct eh_cie_fde *cie_inf;
struct eh_cie_fde *next_for_section;
} fde;