diff --git a/binutils-2.20.51.0.7-dynamic-notes.patch b/binutils-2.20.51.0.7-dynamic-notes.patch new file mode 100644 index 0000000..1e826bb --- /dev/null +++ b/binutils-2.20.51.0.7-dynamic-notes.patch @@ -0,0 +1,35 @@ +*** ../binutils-2.20.51.0.7.orig/bfd/elflink.c 2011-06-10 15:06:15.160479003 +0100 +--- bfd/elflink.c 2011-06-10 15:08:53.737479004 +0100 +*************** bfd_elf_final_link (bfd *abfd, struct bf +*** 11126,11131 **** +--- 11126,11138 ---- + (_("%B: could not find output section %s"), abfd, name); + goto error_return; + } ++ if (elf_section_data (o->output_section)->this_hdr.sh_type == SHT_NOTE) ++ { ++ (*_bfd_error_handler) ++ (_("warning: section '%s' is being made into a note"), name); ++ bfd_set_error (bfd_error_nonrepresentable_section); ++ goto error_return; ++ } + dyn.d_un.d_ptr = o->vma; + break; + +*************** bfd_elf_final_link (bfd *abfd, struct bf +*** 11213,11219 **** + continue; + if ((elf_section_data (o->output_section)->this_hdr.sh_type + != SHT_STRTAB) +! || strcmp (bfd_get_section_name (abfd, o), ".dynstr") != 0) + { + /* FIXME: octets_per_byte. */ + if (! bfd_set_section_contents (abfd, o->output_section, +--- 11220,11226 ---- + continue; + if ((elf_section_data (o->output_section)->this_hdr.sh_type + != SHT_STRTAB) +! && strcmp (bfd_get_section_name (abfd, o), ".dynstr") != 0) + { + /* FIXME: octets_per_byte. */ + if (! bfd_set_section_contents (abfd, o->output_section, diff --git a/binutils.spec b/binutils.spec index ec1557b..f2c9b26 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.7 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -37,6 +37,7 @@ Patch11: binutils-2.20.51.0.7-unique-archive-symbols.patch Patch12: binutils-2.20.51.0.7-gold-INPUT.patch Patch13: binutils-2.20.51.0.7-gas-long-lines.patch Patch14: binutils-2.20.51.0.7-i386-dis.patch +Patch15: binutils-2.20.51.0.7-dynamic-notes.patch %define gold_arches %ix86 x86_64 @@ -141,6 +142,7 @@ using libelf instead of BFD. %patch12 -p0 -b .gold-input~ %patch13 -p0 -b .long-lines~ %patch14 -p0 -b .i386-dis~ +%patch15 -p0 -b .dynamic-notes~ # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -423,6 +425,9 @@ exit 0 %endif # %{isnative} %changelog +* Fri Jun 10 2011 Nick Clifton - 2.20.51.0.7-9 +- Add check for dynamic sections misrepresneted as notes. (BZ 712166) + * Mon May 2 2011 Peter Robinson - 2.20.51.0.7-8 - Add ARM to BFD checks