Test for overflow in eh_frame_hdr entries and for overlapping FDEs
authorAlan Modra <amodra@gmail.com>
Fri, 12 Sep 2014 00:05:42 +0000 (09:35 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 12 Sep 2014 00:14:09 +0000 (09:44 +0930)
commitae6c7e33e1510665e8e043eb11a71e59414efbf3
tree505b0c39d85f07f8e385cb8d4f51846a94ce6ec3
parent18d60c2bd70855afa467f0d5d8f95b3e4d243cde
Test for overflow in eh_frame_hdr entries and for overlapping FDEs

With larger binaries on 64-bit systems, or indeed just binaries that
have a large gap between text and data, it is possible for the
.eh_frame_hdr lookup table entry values to overflow a signed 32-bit
relative offset.  It is also a requirement for the glibc FDE lookup
code that only one FDE claim to cover any given address.

* elf-bfd.h (struct eh_frame_array_ent): Add "range".
* elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Stash address
range of FDEs to hdr_info->array.
(_bfd_elf_write_section_eh_frame_hdr): Report overflow in
.eh_frame_hdr entries, and overlapping FDEs.
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf-eh-frame.c