Fix seg fault in sec_merge_emit(). (BZ 623687)

This commit is contained in:
Nick Clifton 2010-08-20 13:03:04 +01:00
parent d5ad1c59d1
commit fa26cbc678
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,24 @@
*** ../binutils-2.20.51.0.10.orig/bfd/merge.c 2010-08-20 12:19:33.000000000 +0100
--- bfd/merge.c 2010-08-20 12:18:01.000000000 +0100
*************** sec_merge_emit (bfd *abfd, struct sec_me
*** 307,312 ****
--- 307,315 ----
len = -off & (entry->alignment - 1);
if (len != 0)
{
+ /* We should never have an entry with an alignment
+ greater than the section's alignment. */
+ BFD_ASSERT (len <= (bfd_size_type) (1 << alignment_power));
if (bfd_bwrite (pad, len, abfd) != len)
goto err;
off += len;
*************** sec_merge_emit (bfd *abfd, struct sec_me
*** 324,329 ****
--- 327,333 ----
/* Trailing alignment needed? */
off = sec->size - off;
if (off != 0
+ && alignment_power
&& bfd_bwrite (pad, off, abfd) != off)
goto err;

View File

@ -17,7 +17,7 @@
Summary: A GNU collection of binary utilities Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug} Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.20.51.0.10 Version: 2.20.51.0.10
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv3+ License: GPLv3+
Group: Development/Tools Group: Development/Tools
URL: http://sources.redhat.com/binutils URL: http://sources.redhat.com/binutils
@ -32,6 +32,7 @@ Patch06: binutils-2.20.51.0.2-set-long-long.patch
Patch07: binutils-2.20.51.0.2-build-id.patch Patch07: binutils-2.20.51.0.2-build-id.patch
Patch08: binutils-2.20.51.0.10-copy-osabi.patch Patch08: binutils-2.20.51.0.10-copy-osabi.patch
Patch09: binutils-2.20.51.0.10-update-gold.patch Patch09: binutils-2.20.51.0.10-update-gold.patch
Patch10: binutils-2.20.51.0.10-sec-merge-emit.patch
%define gold_arches %ix86 x86_64 %define gold_arches %ix86 x86_64
@ -131,6 +132,7 @@ using libelf instead of BFD.
%patch07 -p0 -b .build-id~ %patch07 -p0 -b .build-id~
%patch08 -p0 -b .copy-osabi~ %patch08 -p0 -b .copy-osabi~
%patch09 -p0 -b .update-gold~ %patch09 -p0 -b .update-gold~
%patch10 -p0 -b .sec-merge-emit~
# We cannot run autotools as there is an exact requirement of autoconf-2.59. # We cannot run autotools as there is an exact requirement of autoconf-2.59.
@ -413,6 +415,9 @@ exit 0
%endif # %{isnative} %endif # %{isnative}
%changelog %changelog
* Fri Aug 20 2010 Nick Clifton <nickc@redhat.com> - 2.20.51.0.10-2
- Fix seg fault in sec_merge_emit(). (BZ 623687)
* Tue Aug 10 2010 Nick Clifton <nickc@redhat.com> - 2.20.51.0.10-1 * Tue Aug 10 2010 Nick Clifton <nickc@redhat.com> - 2.20.51.0.10-1
- Rebase on 2.20.51.0.10 tarball. - Rebase on 2.20.51.0.10 tarball.
- Import GOLD sources from binutils mainline as of 10 Aug 2010. - Import GOLD sources from binutils mainline as of 10 Aug 2010.