diff --git a/gdb-bz614604-bt-cfi-without-die.patch b/gdb-bz614604-bt-cfi-without-die.patch
new file mode 100644
index 0000000..96daf98
--- /dev/null
+++ b/gdb-bz614604-bt-cfi-without-die.patch
@@ -0,0 +1,239 @@
+http://sourceware.org/ml/archer/2010-q3/msg00028.html
+Subject: [delayed-symfile] [commit] Fix a regression on CFI without DIE [Re:
+
+On Wed, 25 Feb 2009 00:14:29 +0100, Jan Kratochvil wrote:
+> commit 6a37c2b9962258ecf9299cc34a650e64a06acaa5
+>
+> There was a regression on gdb.base/savedregs.exp.
+>
+> quick_addrmap/require_partial_symbols should be used even for the unwind debug
+> info checking as its load has been also delayed by this branch.
+[...]
+> --- a/gdb/dwarf2-frame.c
+> +++ b/gdb/dwarf2-frame.c
+[...]
+> @@ -1499,6 +1500,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc)
+> struct dwarf2_fde *fde;
+> CORE_ADDR offset;
+>
+> + if (objfile->quick_addrmap)
+> + {
+> + if (!addrmap_find (objfile->quick_addrmap, *pc))
+> + continue;
+> + }
+> + /* FIXME: Read-in only .debug_frame/.eh_frame without .debug_info? */
+> + require_partial_symbols (objfile);
+> +
+
+but this has caused a different regression (as discussed in the confcall).
+
+QUICK_ADDRMAP is built only from .debug_aranges. But we can have existing
+built .debug_aranges for CUs in OBJFILE but still some CUs do not need to have
+DWARF at all while they can feature CFIs (.eh_frame or .debug_frame).
+It has been described by Daniel Jacobowitz at:
+ Re: [2/4] RFC: check psymtabs_addrmap before reading FDEs
+ http://sourceware.org/ml/gdb-patches/2010-07/msg00012.html
+
+Sorry for this regression by me (in that fix of a different regression).
+
+Fixed it the "slow way" as this branch is now obsoleted by .gdb-index.
+
+No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
+
+Checked-in.
+
+
+Thanks,
+Jan
+
+
+eb8df8566acc1ed963e3e9b77c13b9c2c3db03fb
+
+Test CFI is parsed even for range (function) not described by any DIE.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=614028
+
+gdb/
+ * dwarf2-frame.c (dwarf2_frame_find_fde): Remove the
+ OBJFILE->QUICK_ADDRMAP check. New comment why.
+
+gdb/testsuite/
+ * gdb.base/cfi-without-die.exp, gdb.base/cfi-without-die-main.c,
+ gdb.base/cfi-without-die-caller.c: New files.
+---
+ gdb/dwarf2-frame.c | 8 +--
+ gdb/testsuite/gdb.base/cfi-without-die-caller.c | 28 ++++++++++
+ gdb/testsuite/gdb.base/cfi-without-die-main.c | 32 +++++++++++
+ gdb/testsuite/gdb.base/cfi-without-die.exp | 67 +++++++++++++++++++++++
+ 4 files changed, 130 insertions(+), 5 deletions(-)
+ create mode 100644 gdb/testsuite/gdb.base/cfi-without-die-caller.c
+ create mode 100644 gdb/testsuite/gdb.base/cfi-without-die-main.c
+ create mode 100644 gdb/testsuite/gdb.base/cfi-without-die.exp
+
+diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
+index 5915249..1dc2754 100644
+--- a/gdb/dwarf2-frame.c
++++ b/gdb/dwarf2-frame.c
+@@ -1583,11 +1583,9 @@ dwarf2_frame_find_fde (CORE_ADDR *pc)
+ CORE_ADDR offset;
+ CORE_ADDR seek_pc;
+
+- if (objfile->quick_addrmap)
+- {
+- if (!addrmap_find (objfile->quick_addrmap, *pc))
+- continue;
+- }
++ /* OBJFILE->QUICK_ADDRMAP contains offsets only for DIEs. It does not
++ contain ranges of CFIs. */
++
+ /* FIXME: Read-in only .debug_frame/.eh_frame without .debug_info? */
+ require_partial_symbols (objfile);
+
+diff --git a/gdb/testsuite/gdb.base/cfi-without-die-caller.c b/gdb/testsuite/gdb.base/cfi-without-die-caller.c
+new file mode 100644
+index 0000000..afdfd53
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/cfi-without-die-caller.c
+@@ -0,0 +1,28 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see . */
++
++typedef int (*callback_t) (void);
++
++int
++caller (callback_t callback)
++{
++ /* Ensure some frame content to push away the return address. */
++ volatile const long one = 1;
++
++ /* Modify the return value to prevent any tail-call optimization. */
++ return (*callback) () - one;
++}
+diff --git a/gdb/testsuite/gdb.base/cfi-without-die-main.c b/gdb/testsuite/gdb.base/cfi-without-die-main.c
+new file mode 100644
+index 0000000..8451c4b
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/cfi-without-die-main.c
+@@ -0,0 +1,32 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see . */
++
++typedef int (*callback_t) (void);
++
++extern int caller (callback_t callback);
++
++int
++callback (void)
++{
++ return 1;
++}
++
++int
++main (void)
++{
++ return caller (callback);
++}
+diff --git a/gdb/testsuite/gdb.base/cfi-without-die.exp b/gdb/testsuite/gdb.base/cfi-without-die.exp
+new file mode 100644
+index 0000000..db6d248
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/cfi-without-die.exp
+@@ -0,0 +1,67 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see .
++
++# Test CFI is parsed even for range (function) not described by any DIE.
++
++set testfile cfi-without-die
++set srcmainfile ${testfile}-main.c
++set srccallerfile ${testfile}-caller.c
++set executable ${testfile}
++set objmainfile ${objdir}/${subdir}/${testfile}-main.o
++set objcallerfile ${objdir}/${subdir}/${testfile}-caller.o
++set binfile ${objdir}/${subdir}/${executable}
++
++if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \
++ object [list {additional_flags=-fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables}]] != ""
++ || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != ""
++ || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } {
++ untested ${testfile}.exp
++ return -1
++}
++
++clean_restart $executable
++
++if ![runto callback] then {
++ fail "verify unwinding: Can't run to callback"
++ return 0
++}
++set test "verify unwinding breaks without CFI"
++gdb_test_multiple "bt" $test {
++ -re " in main .*\r\n$gdb_prompt $" {
++ fail $test
++ }
++ -re "\r\n$gdb_prompt $" {
++ pass $test
++ }
++}
++
++if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \
++ object [list {additional_flags=-fomit-frame-pointer -funwind-tables -fasynchronous-unwind-tables}]] != ""
++ || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != ""
++ || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } {
++ untested ${testfile}.exp
++ return -1
++}
++
++clean_restart $executable
++
++if ![runto callback] then {
++ fail "test CFI without DIEs: Can't run to callback"
++ return 0
++}
++# #0 callback () at ...
++# #1 0x00000000004004e9 in caller ()
++# #2 0x00000000004004cd in main () at ...
++gdb_test "bt" "#0 +callback \[^\r\n\]+\r\n#1 \[^\r\n\]+ in caller \[^\r\n\]+\r\n#2 \[^\r\n\]+ in main \[^\r\n\]+" "verify unwindin works for CFI without DIEs"
+--
+1.7.1.1
+
diff --git a/gdb-bz614659-prelink-dynbss.patch b/gdb-bz614659-prelink-dynbss.patch
new file mode 100644
index 0000000..83f7f15
--- /dev/null
+++ b/gdb-bz614659-prelink-dynbss.patch
@@ -0,0 +1,207 @@
+http://sourceware.org/ml/gdb-patches/2010-07/msg00237.html
+Subject: [patch] Fix regression on prelinked executables
+
+Hi,
+
+there is a regression since gdb-7.0 for a combination of:
+ * prelinked
+ * main executable
+ * using separate debug info
+ * using copy relocations
+
+It is since a patch for both PIE and (AFAIK) OSX support:
+ [commit] syms_from_objfile: Relativize also MAINLINE
+ http://sourceware.org/ml/gdb-patches/2010-01/msg00080.html
+
+which started to use problematic addr_info_make_relative even for main
+executables. prelink<->gdb discussion at:
+ https://bugzilla.redhat.com/show_bug.cgi?id=614659
+
+Currently in the unfortunately executables GDB has invalid displcement for
+symbols in .bss:
+ int bssvar, *bssvarp = &bssvar;
+ (gdb) p &bssvar
+ $1 = (int *) 0x600b54
+ (gdb) p bssvarp
+ $2 = (int *) 0x600b50
+
+
+addr_info_make_relative could just simply subtract entry point address and
+provide single CORE_ADDR objfile->offset (instead of the current
+section_offsets array with offsets specific for each section). Linux systems
+use always single offset for the whole objfile. AFAIK these per-section
+offsets are there for some embedded targets. Curiously GDB already uses at
+many places
+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+instead of using offset for the appropriate section at that place and nobody
+complains.
+
+
+No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
+
+Proposing for the gdb-7.2 branch. I had problems fixing up my crashing X.
+
+
+Thanks,
+Jan
+
+
+gdb/
+2010-07-15 Jan Kratochvil
+
+ * symfile.c (addr_section_name): New function.
+ (addrs_section_compar): Use it.
+ (addr_info_make_relative): Use it. Move variable sect_name into a more
+ inner block. Make ".dynbss" and ".sdynbss" checks more strict.
+
+gdb/testsuite/
+2010-07-15 Jan Kratochvil
+
+ * gdb.base/prelink-lib.c (copyreloc): New initialized variable.
+ * gdb.base/prelink.c (copyreloc, bssvar, bssvarp): New variables.
+ (main): Use copyreloc.
+ * gdb.base/prelink.exp (split debug of executable)
+ (.dynbss vs. .bss address shift): New tests.
+
+Index: gdb-7.0.1/gdb/symfile.c
+===================================================================
+--- gdb-7.0.1.orig/gdb/symfile.c 2010-07-20 19:32:29.000000000 +0200
++++ gdb-7.0.1/gdb/symfile.c 2010-07-20 19:33:45.000000000 +0200
+@@ -609,6 +609,23 @@ relative_addr_info_to_section_offsets (s
+ }
+ }
+
++/* Transform section name S for a name comparison. prelink can split section
++ `.bss' into two sections `.dynbss' and `.bss' (in this order). Similarly
++ prelink can split `.sbss' into `.sdynbss' and `.sbss'. Use virtual address
++ of the new `.dynbss' (`.sdynbss') section as the adjacent new `.bss'
++ (`.sbss') section has invalid (increased) virtual address. */
++
++static const char *
++addr_section_name (const char *s)
++{
++ if (strcmp (s, ".dynbss") == 0)
++ return ".bss";
++ if (strcmp (s, ".sdynbss") == 0)
++ return ".sbss";
++
++ return s;
++}
++
+ /* Relativize absolute addresses in ADDRS into offsets based on ABFD. Fill-in
+ also SECTINDEXes specific to ABFD there. This function can be used to
+ rebase ADDRS to start referencing different BFD than before. */
+@@ -661,8 +678,17 @@ addr_info_make_relative (struct section_
+ if (sect && strcmp (sect_name, bfd_get_section_name (abfd, sect)) != 0)
+ sect = NULL;
+
+- if (sect == NULL)
+- sect = bfd_get_section_by_name (abfd, sect_name);
++ /* Prevent the search by name if `.bss' has the address already set from
++ `.dynbss'. */
++ if (sect == NULL
++ && !(0
++ || (strcmp (sect_name, ".bss") == 0
++ && i > 0
++ && strcmp (addrs->other[i - 1].name, ".dynbss") == 0)
++ || (strcmp (sect_name, ".sbss") == 0
++ && i > 0
++ && strcmp (addrs->other[i - 1].name, ".sdynbss") == 0)))
++ sect = bfd_get_section_by_name (abfd, addr_section_name (sect_name));
+ if (sect)
+ {
+ /* This is the index used by BFD. */
+@@ -688,12 +714,18 @@ addr_info_make_relative (struct section_
+ a warning. Shared libraries contain just the section
+ ".gnu.liblist" but it is not marked as loadable there. There is
+ no other way to identify them than by their name as the sections
+- created by prelink have no special flags. */
++ created by prelink have no special flags.
++
++ For the sections `.bss' and `.sbss' see addr_section_name. */
+
+ if (!(strcmp (sect_name, ".gnu.liblist") == 0
+ || strcmp (sect_name, ".gnu.conflict") == 0
+- || strcmp (sect_name, ".dynbss") == 0
+- || strcmp (sect_name, ".sdynbss") == 0))
++ || (strcmp (sect_name, ".bss") == 0
++ && i > 0
++ && strcmp (addrs->other[i - 1].name, ".dynbss") == 0)
++ || (strcmp (sect_name, ".sbss") == 0
++ && i > 0
++ && strcmp (addrs->other[i - 1].name, ".sdynbss") == 0)))
+ warning (_("section %s not found in %s"), sect_name,
+ bfd_get_filename (abfd));
+
+Index: gdb-7.0.1/gdb/testsuite/gdb.base/prelink-lib.c
+===================================================================
+--- gdb-7.0.1.orig/gdb/testsuite/gdb.base/prelink-lib.c 2009-01-03 06:58:03.000000000 +0100
++++ gdb-7.0.1/gdb/testsuite/gdb.base/prelink-lib.c 2010-07-20 19:33:45.000000000 +0200
+@@ -16,6 +16,8 @@
+ along with this program. If not, see .
+ */
+
++int copyreloc = 1;
++
+ int
+ g (void (*p)(void))
+ {
+Index: gdb-7.0.1/gdb/testsuite/gdb.base/prelink.c
+===================================================================
+--- gdb-7.0.1.orig/gdb/testsuite/gdb.base/prelink.c 2009-01-03 06:58:03.000000000 +0100
++++ gdb-7.0.1/gdb/testsuite/gdb.base/prelink.c 2010-07-20 19:33:45.000000000 +0200
+@@ -18,6 +18,11 @@
+
+ #include
+
++extern int copyreloc;
++
++/* Test GDB itself finds `&bssvar' right. */
++static int bssvar, *bssvarp = &bssvar;
++
+ extern void (*h (void)) (void (*)(void));
+
+ int
+@@ -25,5 +30,6 @@ main (void)
+ {
+ void (*f) (void (*)(void)) = h ();
+ printf ("%p\n", f);
++ printf ("%d\n", copyreloc);
+ f (0);
+ }
+Index: gdb-7.0.1/gdb/testsuite/gdb.base/prelink.exp
+===================================================================
+--- gdb-7.0.1.orig/gdb/testsuite/gdb.base/prelink.exp 2010-07-20 19:32:28.000000000 +0200
++++ gdb-7.0.1/gdb/testsuite/gdb.base/prelink.exp 2010-07-20 19:34:20.000000000 +0200
+@@ -66,6 +66,13 @@ if { [gdb_compile "${srcdir}/${subdir}/$
+ return -1;
+ }
+
++set test "split debug of executable"
++if [gdb_gnu_strip_debug $binfile] {
++ fail $test
++} else {
++ pass $test
++}
++
+ set found 0
+ set coredir "${objdir}/${subdir}/coredir.[getpid]"
+ file mkdir $coredir
+@@ -100,7 +107,7 @@ if {[catch "system \"/usr/sbin/prelink -
+ untested "${testfile}.so was not prelinked, maybe system libraries are not prelinked?"
+ return 0
+ }
+-catch "system \"/usr/sbin/prelink -qNR --no-exec-shield ${libfile}\""
++catch "system \"/usr/sbin/prelink -qNR --no-exec-shield ${libfile} ${binfile}\""
+
+ # Start with a fresh gdb
+
+@@ -117,7 +124,4 @@ gdb_test_multiple "core-file $objdir/$su
+ }
+ }
+
+-gdb_exit
+-
+-return 0
+-
++gdb_test "p &bssvar == bssvarp" " = 1" ".dynbss vs. .bss address shift"
diff --git a/gdb.spec b/gdb.spec
index ee0ab66..25bc51d 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -36,7 +36,7 @@ Version: 7.0.1
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 48%{?_with_upstream:.upstream}%{dist}
+Release: 49%{?_with_upstream:.upstream}%{dist}
License: GPLv3+
Group: Development/Debuggers
@@ -503,6 +503,12 @@ Patch462: gdb-bz595475-tui-layout.patch
# Fix follow-exec for C++ programs (bugreported by Martin Stransky).
Patch470: gdb-archer-next-over-throw-cxx-exec.patch
+# Fix prelinked executables with sepdebug and copy relocations (BZ 614659).
+Patch489: gdb-bz614659-prelink-dynbss.patch
+
+# [delayed-symfile] Fix a backtrace regression on CFIs without DIE (BZ 614604).
+Patch490: gdb-bz614604-bt-cfi-without-die.patch
+
BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
Requires: readline%{?_isa}
BuildRequires: readline-devel%{?_isa}
@@ -775,6 +781,8 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch454 -p1
%patch462 -p1
%patch470 -p1
+%patch489 -p1
+%patch490 -p1
# Always verify their applicability.
%patch393 -p1
%patch335 -p1
@@ -1100,6 +1108,10 @@ fi
%endif
%changelog
+* Tue Jul 20 2010 Jan Kratochvil - 7.0.1-49.fc12
+- Fix prelinked executables with sepdebug and copy relocations (BZ 614659).
+- [delayed-symfile] Fix a backtrace regression on CFIs without DIE (BZ 614604).
+
* Wed Jun 2 2010 Jan Kratochvil - 7.0.1-48.fc12
- Fix Java-related crash (BZ 566145, Tom Tromey).