From fa26cbc678d60fcaa4eae04cde261228d61782d7 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Aug 20 2010 12:03:04 +0000 Subject: Fix seg fault in sec_merge_emit(). (BZ 623687) --- diff --git a/binutils-2.20.51.0.10-sec-merge-emit.patch b/binutils-2.20.51.0.10-sec-merge-emit.patch new file mode 100644 index 0000000..388e143 --- /dev/null +++ b/binutils-2.20.51.0.10-sec-merge-emit.patch @@ -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; + diff --git a/binutils.spec b/binutils.spec index 8fdeb1a..905b4e6 100644 --- a/binutils.spec +++ b/binutils.spec @@ -17,7 +17,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.20.51.0.10 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: Development/Tools 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 Patch08: binutils-2.20.51.0.10-copy-osabi.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 @@ -131,6 +132,7 @@ using libelf instead of BFD. %patch07 -p0 -b .build-id~ %patch08 -p0 -b .copy-osabi~ %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. @@ -413,6 +415,9 @@ exit 0 %endif # %{isnative} %changelog +* Fri Aug 20 2010 Nick Clifton - 2.20.51.0.10-2 +- Fix seg fault in sec_merge_emit(). (BZ 623687) + * Tue Aug 10 2010 Nick Clifton - 2.20.51.0.10-1 - Rebase on 2.20.51.0.10 tarball. - Import GOLD sources from binutils mainline as of 10 Aug 2010.