diff --git a/binutils-2.18.50.0.9-gcc_except_table.patch b/binutils-2.18.50.0.9-gcc_except_table.patch new file mode 100644 index 0000000..637e7df --- /dev/null +++ b/binutils-2.18.50.0.9-gcc_except_table.patch @@ -0,0 +1,115 @@ +https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=461675 +http://sourceware.org/ml/binutils/2009-01/msg00412.html +http://sourceware.org/ml/binutils-cvs/2009-02/msg00003.html + +bfd/ +2009-02-01 Jan Kratochvil + + * elf-eh-frame.c (REQUIRE_CLEARED_RELOCS) Remove. + (_bfd_elf_parse_eh_frame): Do not check relocations for removed FDEs. + +ld/testsuite/ +2009-02-01 Jan Kratochvil + + * ld-elf/eh-group2.s: New `.cfi_lsda' referencing `.gcc_except_table'. + * ld-elf/eh-group.exp: New test and conditional defininiton of `ELF64'. + +--- bfd/elf-eh-frame.c 2008/09/17 07:50:28 1.73 ++++ bfd/elf-eh-frame.c 2009/02/01 12:05:25 1.74 +@@ -549,16 +549,6 @@ + < (bfd_size_type) ((buf) - ehbuf))) \ + cookie->rel++ + +-#define REQUIRE_CLEARED_RELOCS(buf) \ +- while (cookie->rel < cookie->relend \ +- && (cookie->rel->r_offset \ +- < (bfd_size_type) ((buf) - ehbuf))) \ +- { \ +- REQUIRE (cookie->rel->r_info == 0); \ +- REQUIRE (cookie->rel->r_addend == 0); \ +- cookie->rel++; \ +- } +- + #define GET_RELOC(buf) \ + ((cookie->rel < cookie->relend \ + && (cookie->rel->r_offset \ +@@ -817,16 +807,16 @@ + + buf = last_fde + 4 + hdr_length; + +- /* Cleared FDE? The instructions will not be cleared but verify all +- the relocation entries for them are cleared. */ +- if (rsec == NULL) +- { +- REQUIRE_CLEARED_RELOCS (buf); +- } +- else +- { +- SKIP_RELOCS (buf); +- } ++ /* For NULL RSEC (cleared FDE belonging to a discarded section) ++ the relocations are commonly cleared. We do not sanity check if ++ all these relocations are cleared as (1) relocations to ++ .gcc_except_table will remain uncleared (they will get dropped ++ with the drop of this unused FDE) and (2) BFD already safely drops ++ relocations of any type to .eh_frame by ++ elf_section_ignore_discarded_relocs. ++ TODO: The .gcc_except_table entries should be also filtered as ++ .eh_frame entries; or GCC could rather use COMDAT for them. */ ++ SKIP_RELOCS (buf); + } + + /* Try to interpret the CFA instructions and find the first +--- ld/testsuite/ld-elf/eh-group.exp 2008/09/25 03:16:42 1.3 ++++ ld/testsuite/ld-elf/eh-group.exp 2009/02/01 12:05:25 1.4 +@@ -40,12 +40,28 @@ + return + } + +-set build_tests_ld { +- {"Build eh-group1.o" +- "-r" "" +- {eh-group1.s eh-group2.s} {} "eh-group.o"} ++# alpha-linux-gnu does not support 64-bit relocations: ++# relocation truncated to fit: REFLONG against `.gcc_except_table' ++# arm-eabi does not support 64-bit relocations: ++# bad relocation fixup type (1) ++set testname "Guess the target size from eh-group1size.o" ++if [ld_assemble $as "$srcdir/$subdir/eh-group1.s" "tmpdir/eh-group1size.o"] { ++ pass $testname ++} else { ++ fail $testname + } + ++set as_options "" ++if [is_elf64 "tmpdir/eh-group1size.o"] { ++ set as_options "$as_options --defsym ELF64=1" ++} ++ ++set build_tests_ld [list \ ++ [list "Build eh-group1.o" \ ++ "-r" "$as_options" \ ++ {eh-group1.s eh-group2.s} {} "eh-group.o"] \ ++] ++ + run_ld_link_tests $build_tests_ld + + set testname "Link eh-group.o to eh-group" +--- ld/testsuite/ld-elf/eh-group2.s 2008/09/20 08:42:53 1.2 ++++ ld/testsuite/ld-elf/eh-group2.s 2009/02/01 12:05:25 1.3 +@@ -1,4 +1,15 @@ + .section sect, "axG", %progbits, sectgroup, comdat + .cfi_startproc ++# Test intention is that LSDA must be provided by the discarded FDE. ++# DW_EH_PE_udata8 = 4 ++# DW_EH_PE_udata4 = 3 ++ .ifdef ELF64 ++ .cfi_lsda 4, lsda ++ .else ++ .cfi_lsda 3, lsda ++ .endif + .skip 16 + .cfi_endproc ++ ++ .section .gcc_except_table, "a", %progbits ++lsda: diff --git a/binutils.spec b/binutils.spec index 494a615..c6691fc 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.18.50.0.9 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -33,6 +33,7 @@ Patch11: binutils-2.18.50.0.9-largefile.patch Patch12: binutils-2.18.50.0.9-set-long-long.patch Patch13: binutils-2.18.50.0.9-upstream.patch Patch14: binutils-2.18.50.0.9-linkonce-r-discard.patch +Patch15: binutils-2.18.50.0.9-gcc_except_table.patch %if 0%{?_with_debug:1} # Define this if you want to skip the strip step and preserve debug info. @@ -106,6 +107,7 @@ to consider using libelf instead of BFD. %patch12 -p0 -b .set-long-long~ %patch13 -p0 -b .upstream~ %patch14 -p0 -b .linkonce-r-discard~ +%patch15 -p0 -b .gcc_except_table~ # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -349,6 +351,9 @@ fi %endif # %{isnative} %changelog +* Mon Feb 2 2009 Jan Kratochvil 2.18.50.0.9-8 +- Fix .eh_frame_hdr build also for .gcc_except_table LSDA refs (BZ 461675). + * Thu Oct 30 2008 Jan Kratochvil 2.18.50.0.9-7 - Fix %%{_prefix}/include/bfd.h on 32-bit hosts due the 64-bit BFD target support from 2.18.50.0.8-2 (BZ 468495).