summaryrefslogtreecommitdiffstats
path: root/bfd/elf-eh-frame.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-04-05 19:32:06 +0000
committerJakub Jelinek <jakub@redhat.com>2010-04-05 19:32:06 +0000
commit604282a73114a629e84ed6b81d0a22ed65c3d33e (patch)
treed7f5eab445e0be1b89fd9682fd584dcc1e6b39fa /bfd/elf-eh-frame.c
parenta233b20c0e8f6e841c67b54b788f2649942eb7ed (diff)
downloadppe42-binutils-604282a73114a629e84ed6b81d0a22ed65c3d33e.tar.gz
ppe42-binutils-604282a73114a629e84ed6b81d0a22ed65c3d33e.zip
bfd/
* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Handle CIE version 4 provided that it has the expected address size and zero segment length. binutils/ * dwarf.c (struct Frame_Chunk): Add ptr_size and segment_size fields. (display_debug_frames): Handle CIE version 4.
Diffstat (limited to 'bfd/elf-eh-frame.c')
-rw-r--r--bfd/elf-eh-frame.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index 37c92553ce..c948df27a3 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
+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
@@ -636,7 +636,9 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
REQUIRE (read_byte (&buf, end, &cie->version));
/* Cannot handle unknown versions. */
- REQUIRE (cie->version == 1 || cie->version == 3);
+ REQUIRE (cie->version == 1
+ || cie->version == 3
+ || cie->version == 4);
REQUIRE (strlen ((char *) buf) < sizeof (cie->augmentation));
strcpy (cie->augmentation, (char *) buf);
@@ -651,6 +653,13 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
REQUIRE (skip_bytes (&buf, end, ptr_size));
SKIP_RELOCS (buf);
}
+ if (cie->version >= 4)
+ {
+ REQUIRE (buf + 1 < end);
+ REQUIRE (buf[0] == ptr_size);
+ REQUIRE (buf[1] == 0);
+ buf += 2;
+ }
REQUIRE (read_uleb128 (&buf, end, &cie->code_align));
REQUIRE (read_sleb128 (&buf, end, &cie->data_align));
if (cie->version == 1)
OpenPOWER on IntegriCloud