From fdf11690304a4720691676323efa9780f68d5cf1 Mon Sep 17 00:00:00 2001 From: Nicholas Clifton Date: Jul 14 2009 09:48:32 +0000 Subject: Fix build-id patch to avoid memory corruption. (BZ 501582) --- diff --git a/binutils-2.19.51.0.10-build-id.patch b/binutils-2.19.51.0.10-build-id.patch index 8721c7f..35a8016 100644 --- a/binutils-2.19.51.0.10-build-id.patch +++ b/binutils-2.19.51.0.10-build-id.patch @@ -1,7 +1,7 @@ -diff -rup ../binutils-2.19.51.0.10.orig/bfd/elfcode.h ./bfd/elfcode.h ---- ../binutils-2.19.51.0.10.orig/bfd/elfcode.h 2009-06-22 16:16:08.000000000 +0100 -+++ ./bfd/elfcode.h 2009-06-22 16:20:00.000000000 +0100 -@@ -1170,6 +1170,20 @@ elf_checksum_contents (bfd *abfd, +diff -rup ../binutils-2.19.51.0.11.orig/bfd/elfcode.h bfd/elfcode.h +--- ../binutils-2.19.51.0.11.orig/bfd/elfcode.h 2009-07-14 11:23:27.000000000 +0100 ++++ bfd/elfcode.h 2009-07-14 11:33:56.000000000 +0100 +@@ -1170,6 +1170,24 @@ elf_checksum_contents (bfd *abfd, if (i_shdr.contents) (*process) (i_shdr.contents, i_shdr.sh_size, arg); @@ -12,9 +12,13 @@ diff -rup ../binutils-2.19.51.0.10.orig/bfd/elfcode.h ./bfd/elfcode.h + sec = bfd_section_from_elf_index (abfd, count); + if (sec != NULL) + { -+ if (sec->contents == NULL -+ && ! bfd_malloc_and_get_section (abfd, sec, & sec->contents)) -+ continue; ++ if (sec->contents == NULL) ++ { ++ /* Force rereading from file. */ ++ sec->flags &= ~SEC_IN_MEMORY; ++ if (! bfd_malloc_and_get_section (abfd, sec, & sec->contents)) ++ continue; ++ } + if (sec->contents != NULL) + (*process) (sec->contents, i_shdr.sh_size, arg); + } @@ -22,9 +26,9 @@ diff -rup ../binutils-2.19.51.0.10.orig/bfd/elfcode.h ./bfd/elfcode.h } return TRUE; -diff -rup ../binutils-2.19.51.0.10.orig/bfd/section.c ./bfd/section.c ---- ../binutils-2.19.51.0.10.orig/bfd/section.c 2009-06-22 16:16:08.000000000 +0100 -+++ ./bfd/section.c 2009-06-22 16:20:42.000000000 +0100 +diff -rup ../binutils-2.19.51.0.11.orig/bfd/section.c bfd/section.c +--- ../binutils-2.19.51.0.11.orig/bfd/section.c 2009-07-14 11:23:27.000000000 +0100 ++++ bfd/section.c 2009-07-14 11:33:26.000000000 +0100 @@ -1477,7 +1477,7 @@ bfd_malloc_and_get_section (bfd *abfd, s if (sz == 0) return TRUE; diff --git a/binutils.spec b/binutils.spec index 47996e4..042a69c 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.19.51.0.11 -Release: 24%{?dist} +Release: 25%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -351,6 +351,9 @@ fi %endif # %{isnative} %changelog +* Tue Jul 14 2009 Nick Clifton 2.19.51.0.11-25 +- Fix build-id patch to avoid memory corruption. (BZ 501582) + * Sat Jul 11 2009 Jan Kratochvil 2.19.51.0.11-24 - Provide uuencode output of the testsuite results.