X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bfd%2Felf-eh-frame.c;h=6919ac3031bedf8b9748f643ddcdbfc7d0ffe8a2;hb=b4c555cfc48689d45481effff23c9017a4f3557f;hp=b76a657709f94b64a21bd458aed7f83304bca0dd;hpb=3a67e1a6b4430374f3073e51bb19347d4c421cfe;p=external%2Fbinutils.git diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index b76a657..6919ac3 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -1,5 +1,5 @@ /* .eh_frame section optimization. - Copyright (C) 2001-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2019 Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. @@ -1993,7 +1993,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, || ent->u.cie.per_encoding_relative) { char *aug; - unsigned int action, extra_string, extra_data; + unsigned int version, action, extra_string, extra_data; unsigned int per_width, per_encoding; /* Need to find 'R' or 'L' augmentation's argument and modify @@ -2004,13 +2004,17 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, extra_string = extra_augmentation_string_bytes (ent); extra_data = extra_augmentation_data_bytes (ent); - /* Skip length, id and version. */ - buf += 9; + /* Skip length, id. */ + buf += 8; + version = *buf++; aug = (char *) buf; buf += strlen (aug) + 1; skip_leb128 (&buf, end); skip_leb128 (&buf, end); - skip_leb128 (&buf, end); + if (version == 1) + skip_bytes (&buf, end, 1); + else + skip_leb128 (&buf, end); if (*aug == 'z') { /* The uleb128 will always be a single byte for the kind