diff options
author | Alan Modra <amodra@bigpond.net.au> | 2011-06-14 12:57:17 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2011-06-14 12:57:17 +0000 |
commit | b4abd122af708f021d318356de38338247cfd5f8 (patch) | |
tree | c2ed814f9665568f009b4dd86b89de726fd2ffe9 /bfd | |
parent | eb0fce0e2a0067d314a2855bd96f7bc084360968 (diff) | |
download | binutils-redhat-b4abd122af708f021d318356de38338247cfd5f8.tar.gz |
PR ld/12887
* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Check sec_info_type
before doing anything.
(_bfd_elf_discard_section_eh_frame): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf-eh-frame.c | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 0c3dfdf88c..0fd8e4f0b2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,12 @@ 2011-06-14 Alan Modra <amodra@gmail.com> + PR ld/12887 + * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Check sec_info_type + before doing anything. + (_bfd_elf_discard_section_eh_frame): Likewise. + +2011-06-14 Alan Modra <amodra@gmail.com> + * Makefile.am: Formatting. * Makefile.in: Regenerate. * configure.in (bfd_elf64_tilegx_vec): Add elfxx-tilegx.lo. diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 0a22138147..21041a5b40 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -1,5 +1,5 @@ /* .eh_frame section optimization. - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Jakub Jelinek <jakub@redhat.com>. @@ -490,7 +490,8 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, if (hdr_info->parsed_eh_frames) return; - if (sec->size == 0) + if (sec->size == 0 + || sec->sec_info_type != ELF_INFO_TYPE_NONE) { /* This file does not contain .eh_frame information. */ return; @@ -1133,6 +1134,9 @@ _bfd_elf_discard_section_eh_frame struct eh_frame_hdr_info *hdr_info; unsigned int ptr_size, offset; + if (sec->sec_info_type != ELF_INFO_TYPE_EH_FRAME) + return FALSE; + sec_info = (struct eh_frame_sec_info *) elf_section_data (sec)->sec_info; if (sec_info == NULL) return FALSE; |