From: Alan Modra Date: Fri, 25 Jan 2002 06:24:34 +0000 (+0000) Subject: * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c68836a9c07fe3bb11256a080fff889743a89aa1;p=binutils-gdb.git * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid unsigned overflow when new_offset < old_offset. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d920d182bbb..e30f06a93cf 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-01-25 Alan Modra + + * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid + unsigned overflow when new_offset < old_offset. + 2002-24-01 Philipp Thomas * bfd.c (_bfd_abort): Fix typo. diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 56a59da410c..b479c00f323 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -1,5 +1,5 @@ /* .eh_frame section optimization. - Copyright 2001 Free Software Foundation, Inc. + Copyright 2001, 2002 Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. @@ -867,8 +867,8 @@ _bfd_elf_eh_frame_section_offset (output_bfd, sec, offset) + sec_info->entry[mid].lsda_offset))) return (bfd_vma) -1; - return (offset - + (sec_info->entry[mid].new_offset - sec_info->entry[mid].offset)); + return (offset + sec_info->entry[mid].new_offset + - sec_info->entry[mid].offset); } /* Write out .eh_frame section. This is called with the relocated