- Update to new FSF GDB release.
This commit is contained in:
parent
37c8c133f1
commit
2770a5f431
|
@ -1,2 +1,2 @@
|
|||
gdb-7.0.90.20100312.tar.bz2
|
||||
gdb-7.1.tar.bz2
|
||||
libstdc++-v3-python-r155978.tar.bz2
|
||||
|
|
|
@ -58,10 +58,10 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
|
|||
* exec.c (exec_file_attach): Print a more useful error message if the
|
||||
user did "gdb core".
|
||||
|
||||
Index: gdb-7.0.90.20100306/gdb/exceptions.h
|
||||
Index: gdb-7.1/gdb/exceptions.h
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/exceptions.h 2010-01-18 07:25:22.000000000 +0100
|
||||
+++ gdb-7.0.90.20100306/gdb/exceptions.h 2010-03-06 23:30:56.000000000 +0100
|
||||
--- gdb-7.1.orig/gdb/exceptions.h 2010-01-18 07:25:22.000000000 +0100
|
||||
+++ gdb-7.1/gdb/exceptions.h 2010-03-25 18:40:49.000000000 +0100
|
||||
@@ -78,6 +78,9 @@ enum errors {
|
||||
/* Feature is not supported in this copy of GDB. */
|
||||
UNSUPPORTED_ERROR,
|
||||
|
@ -72,19 +72,19 @@ Index: gdb-7.0.90.20100306/gdb/exceptions.h
|
|||
/* Add more errors here. */
|
||||
NR_ERRORS
|
||||
};
|
||||
Index: gdb-7.0.90.20100306/gdb/exec.c
|
||||
Index: gdb-7.1/gdb/exec.c
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/exec.c 2010-03-06 23:29:06.000000000 +0100
|
||||
+++ gdb-7.0.90.20100306/gdb/exec.c 2010-03-06 23:31:40.000000000 +0100
|
||||
@@ -35,6 +35,7 @@
|
||||
--- gdb-7.1.orig/gdb/exec.c 2010-03-25 17:46:11.000000000 +0100
|
||||
+++ gdb-7.1/gdb/exec.c 2010-03-25 18:41:09.000000000 +0100
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "arch-utils.h"
|
||||
#include "gdbthread.h"
|
||||
#include "progspace.h"
|
||||
#include "solib.h"
|
||||
+#include "exceptions.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include "readline/readline.h"
|
||||
@@ -264,6 +265,17 @@ exec_file_attach (char *filename, int fr
|
||||
@@ -259,6 +260,17 @@ exec_file_attach (char *filename, int fr
|
||||
/* Make sure to close exec_bfd, or else "run" might try to use
|
||||
it. */
|
||||
exec_close ();
|
||||
|
@ -102,10 +102,10 @@ Index: gdb-7.0.90.20100306/gdb/exec.c
|
|||
error (_("\"%s\": not in executable format: %s"),
|
||||
scratch_pathname,
|
||||
gdb_bfd_errmsg (bfd_get_error (), matching));
|
||||
Index: gdb-7.0.90.20100306/gdb/main.c
|
||||
Index: gdb-7.1/gdb/main.c
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/main.c 2010-03-06 23:20:35.000000000 +0100
|
||||
+++ gdb-7.0.90.20100306/gdb/main.c 2010-03-06 23:30:56.000000000 +0100
|
||||
--- gdb-7.1.orig/gdb/main.c 2010-03-25 17:46:11.000000000 +0100
|
||||
+++ gdb-7.1/gdb/main.c 2010-03-25 18:40:49.000000000 +0100
|
||||
@@ -241,6 +241,36 @@ captured_command_loop (void *data)
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -51,55 +51,6 @@ Index: gdb-7.0.90.20100306/gdb/dwarf2read.c
|
|||
|
||||
set_die_type (die, type, cu);
|
||||
}
|
||||
Index: gdb-7.0.90.20100306/gdb/exec.c
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/exec.c 2010-03-06 23:21:01.000000000 +0100
|
||||
+++ gdb-7.0.90.20100306/gdb/exec.c 2010-03-06 23:29:06.000000000 +0100
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "arch-utils.h"
|
||||
#include "gdbthread.h"
|
||||
#include "progspace.h"
|
||||
+#include "solib.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include "readline/readline.h"
|
||||
@@ -220,6 +221,10 @@ exec_file_attach (char *filename, int fr
|
||||
int scratch_chan;
|
||||
struct target_section *sections = NULL, *sections_end = NULL;
|
||||
char **matching;
|
||||
+ struct target_section *p;
|
||||
+ int addr_bit;
|
||||
+ CORE_ADDR mask = CORE_ADDR_MAX;
|
||||
+ CORE_ADDR displacement;
|
||||
|
||||
scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, filename,
|
||||
write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY,
|
||||
@@ -289,12 +294,23 @@ exec_file_attach (char *filename, int fr
|
||||
scratch_pathname, bfd_errmsg (bfd_get_error ()));
|
||||
}
|
||||
|
||||
+ set_gdbarch_from_file (exec_bfd);
|
||||
+
|
||||
+ addr_bit = gdbarch_addr_bit (target_gdbarch);
|
||||
+ if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
|
||||
+ mask = ((CORE_ADDR) 1 << addr_bit) - 1;
|
||||
+
|
||||
+ displacement = solib_exec_displacement ();
|
||||
+ for (p = sections; p < sections_end; p++)
|
||||
+ {
|
||||
+ p->addr = (p->addr + displacement) & mask;
|
||||
+ p->endaddr = (p->endaddr + displacement) & mask;
|
||||
+ }
|
||||
+
|
||||
exec_bfd_mtime = bfd_get_mtime (exec_bfd);
|
||||
|
||||
validate_files ();
|
||||
|
||||
- set_gdbarch_from_file (exec_bfd);
|
||||
-
|
||||
/* Add the executable's sections to the current address spaces'
|
||||
list of sections. This possibly pushes the exec_ops
|
||||
target. */
|
||||
Index: gdb-7.0.90.20100306/gdb/gdbtypes.h
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/gdbtypes.h 2010-03-06 23:26:34.000000000 +0100
|
||||
|
@ -168,138 +119,6 @@ Index: gdb-7.0.90.20100306/gdb/jv-lang.c
|
|||
else
|
||||
TYPE_FIELD_BITPOS (type, i) = 8 * boffset;
|
||||
if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */
|
||||
Index: gdb-7.0.90.20100306/gdb/solib-svr4.c
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/solib-svr4.c 2010-03-06 23:26:34.000000000 +0100
|
||||
+++ gdb-7.0.90.20100306/gdb/solib-svr4.c 2010-03-06 23:28:43.000000000 +0100
|
||||
@@ -1767,7 +1767,10 @@ svr4_exec_displacement (void)
|
||||
if (target_auxv_search (¤t_target, AT_ENTRY, &entry_point) == 1)
|
||||
return entry_point - bfd_get_start_address (exec_bfd);
|
||||
|
||||
- return svr4_static_exec_displacement ();
|
||||
+ if (!ptid_equal (inferior_ptid, null_ptid))
|
||||
+ return svr4_static_exec_displacement ();
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/* Relocate the main executable. This function should be called upon
|
||||
@@ -1778,7 +1781,7 @@ svr4_exec_displacement (void)
|
||||
static void
|
||||
svr4_relocate_main_executable (void)
|
||||
{
|
||||
- CORE_ADDR displacement = svr4_exec_displacement ();
|
||||
+ CORE_ADDR displacement = solib_exec_displacement ();
|
||||
|
||||
/* Even if DISPLACEMENT is 0 still try to relocate it as this is a new
|
||||
difference of in-memory vs. in-file addresses and we could already
|
||||
@@ -2130,6 +2133,7 @@ _initialize_svr4_solib (void)
|
||||
svr4_so_ops.free_so = svr4_free_so;
|
||||
svr4_so_ops.clear_solib = svr4_clear_solib;
|
||||
svr4_so_ops.solib_create_inferior_hook = svr4_solib_create_inferior_hook;
|
||||
+ svr4_so_ops.exec_displacement = svr4_exec_displacement;
|
||||
svr4_so_ops.special_symbol_handling = svr4_special_symbol_handling;
|
||||
svr4_so_ops.current_sos = svr4_current_sos;
|
||||
svr4_so_ops.open_symbol_file_object = open_symbol_file_object;
|
||||
Index: gdb-7.0.90.20100306/gdb/solib.c
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/solib.c 2010-03-06 23:26:34.000000000 +0100
|
||||
+++ gdb-7.0.90.20100306/gdb/solib.c 2010-03-06 23:28:43.000000000 +0100
|
||||
@@ -1039,6 +1039,19 @@ solib_create_inferior_hook (int from_tty
|
||||
ops->solib_create_inferior_hook (from_tty);
|
||||
}
|
||||
|
||||
+/* Query the difference of in-memory VMA addresses vs. exec_bfd VMAs. */
|
||||
+
|
||||
+CORE_ADDR
|
||||
+solib_exec_displacement (void)
|
||||
+{
|
||||
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
|
||||
+
|
||||
+ if (ops->exec_displacement != NULL)
|
||||
+ return (*ops->exec_displacement) ();
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* GLOBAL FUNCTION
|
||||
|
||||
in_solib_dynsym_resolve_code -- check to see if an address is in
|
||||
Index: gdb-7.0.90.20100306/gdb/solib.h
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/solib.h 2010-01-08 23:52:04.000000000 +0100
|
||||
+++ gdb-7.0.90.20100306/gdb/solib.h 2010-03-06 23:28:43.000000000 +0100
|
||||
@@ -44,6 +44,8 @@ extern int solib_read_symbols (struct so
|
||||
|
||||
extern void solib_create_inferior_hook (int from_tty);
|
||||
|
||||
+extern CORE_ADDR solib_exec_displacement (void);
|
||||
+
|
||||
/* If ADDR lies in a shared library, return its name. */
|
||||
|
||||
extern char *solib_name_from_address (struct program_space *, CORE_ADDR);
|
||||
Index: gdb-7.0.90.20100306/gdb/solist.h
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/solist.h 2010-03-06 23:19:13.000000000 +0100
|
||||
+++ gdb-7.0.90.20100306/gdb/solist.h 2010-03-06 23:28:43.000000000 +0100
|
||||
@@ -92,6 +92,9 @@ struct target_so_ops
|
||||
/* Target dependent code to run after child process fork. */
|
||||
void (*solib_create_inferior_hook) (int from_tty);
|
||||
|
||||
+ /* Query the difference of in-memory VMA addresses vs. exec_bfd VMAs. */
|
||||
+ CORE_ADDR (*exec_displacement) (void);
|
||||
+
|
||||
/* Do additional symbol handling, lookup, etc. after symbols
|
||||
for a shared object have been loaded. */
|
||||
void (*special_symbol_handling) (void);
|
||||
Index: gdb-7.0.90.20100306/gdb/symfile.c
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/symfile.c 2010-03-06 23:26:25.000000000 +0100
|
||||
+++ gdb-7.0.90.20100306/gdb/symfile.c 2010-03-06 23:28:43.000000000 +0100
|
||||
@@ -827,15 +827,36 @@ syms_from_objfile (struct objfile *objfi
|
||||
if an error occurs during symbol reading. */
|
||||
old_chain = make_cleanup_free_objfile (objfile);
|
||||
|
||||
- /* If ADDRS and OFFSETS are both NULL, put together a dummy address
|
||||
- list. We now establish the convention that an addr of zero means
|
||||
- no load address was specified. */
|
||||
+ /* If ADDRS and OFFSETS are both NULL, put together a dummy offset list. */
|
||||
+
|
||||
if (! addrs && ! offsets)
|
||||
{
|
||||
- local_addr
|
||||
- = alloc_section_addr_info (bfd_count_sections (objfile->obfd));
|
||||
- make_cleanup (xfree, local_addr);
|
||||
- addrs = local_addr;
|
||||
+ /* Relocateble files have an exception in default_symfile_offsets which
|
||||
+ applies only for ADDRS. But calling solib_exec_displacement is more
|
||||
+ suitable for OFFSETS. Fortunately we never need the both
|
||||
+ functionalities simultaneously and in other cases zeroed ADDRS and
|
||||
+ zeroed OFFSETS are equivalent. */
|
||||
+
|
||||
+ if ((bfd_get_file_flags (objfile->obfd) & (EXEC_P | DYNAMIC)) == 0)
|
||||
+ {
|
||||
+ local_addr
|
||||
+ = alloc_section_addr_info (bfd_count_sections (objfile->obfd));
|
||||
+ make_cleanup (xfree, local_addr);
|
||||
+ addrs = local_addr;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ CORE_ADDR displacement = 0;
|
||||
+ int i;
|
||||
+
|
||||
+ if (mainline)
|
||||
+ displacement = solib_exec_displacement ();
|
||||
+
|
||||
+ num_offsets = bfd_count_sections (objfile->obfd);
|
||||
+ offsets = alloca (SIZEOF_N_SECTION_OFFSETS (num_offsets));
|
||||
+ for (i = 0; i < num_offsets; i++)
|
||||
+ offsets->offsets[i] = displacement;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* Now either addrs or offsets is non-zero. */
|
||||
Index: gdb-7.0.90.20100306/gdb/value.c
|
||||
===================================================================
|
||||
--- gdb-7.0.90.20100306.orig/gdb/value.c 2010-03-06 23:19:13.000000000 +0100
|
||||
|
|
|
@ -1,114 +0,0 @@
|
|||
http://sourceware.org/ml/gdb-patches/2010-02/msg00713.html
|
||||
Subject: Re: [patch] Fix false warning: section .gnu.liblist not found in ... [rediffed]
|
||||
|
||||
Hi,
|
||||
|
||||
only a technical rediff.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
On Sat, 13 Feb 2010 23:49:29 +0100, Jan Kratochvil wrote:
|
||||
Hi,
|
||||
|
||||
post-7.0 GDB started to print many false warnings on prelink-ed system:
|
||||
|
||||
$ ./gdb -nx -ex r echo
|
||||
...
|
||||
Reading symbols from /bin/echo...Reading symbols from /usr/lib/debug/bin/echo.debug...
|
||||
warning: section .gnu.liblist not found in /usr/lib/debug/bin/echo.debug
|
||||
warning: section .gnu.conflict not found in /usr/lib/debug/bin/echo.debug
|
||||
done.
|
||||
done.
|
||||
Starting program: /bin/echo
|
||||
warning: section .gnu.liblist not found in /usr/lib/debug/bin/echo.debug
|
||||
warning: section .gnu.conflict not found in /usr/lib/debug/bin/echo.debug
|
||||
warning: section .gnu.liblist not found in /usr/lib/debug/bin/echo.debug
|
||||
warning: section .gnu.conflict not found in /usr/lib/debug/bin/echo.debug
|
||||
warning: section .gnu.liblist not found in /usr/lib/debug/bin/echo.debug
|
||||
warning: section .gnu.conflict not found in /usr/lib/debug/bin/echo.debug
|
||||
|
||||
These sections are from prelink and they are not present in the *.debug files.
|
||||
|
||||
It is formally a regression by:
|
||||
|
||||
commit 3bfec189bb0fa1a2a44f1645dd68a9572e7a841c
|
||||
|
||||
2010-01-07 Tristan Gingold <gingold@adacore.com>
|
||||
|
||||
* symfile.c (build_section_addr_info_from_objfile): New function.
|
||||
(symbol_file_add_separate): Don't use offsets from objfile but
|
||||
built an addr info.
|
||||
|
||||
|
||||
But I think would be unavoidable even for the unification of PIC+PIE handling.
|
||||
|
||||
Found no usable section flag differences for .gnu.liblist vs. for example
|
||||
.text so used just the section name for the exception.
|
||||
|
||||
.gnu.liblist/.gnu.conflict related dumps:
|
||||
|
||||
executable:
|
||||
Section Headers:
|
||||
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
|
||||
[ 6] .gnu.liblist GNU_LIBLIST 00000000004006b8 0006b8 000028 14 A 28 0 4
|
||||
[ 7] .gnu.conflict RELA 00000000004006e0 0006e0 0001c8 18 A 5 0 8
|
||||
Program Headers:
|
||||
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
|
||||
LOAD 0x000000 0x0000000000400000 0x0000000000400000 0x005254 0x005254 R E 0x200000
|
||||
Dynamic section at offset 0x52c8 contains 24 entries:
|
||||
Tag Type Name/Value
|
||||
0x000000006ffffef9 (GNU_LIBLIST) 0x4006b8
|
||||
0x000000006ffffdf7 (GNU_LIBLISTSZ) 40 (bytes)
|
||||
0x000000006ffffef8 (GNU_CONFLICT) 0x4006e0
|
||||
0x000000006ffffdf6 (GNU_CONFLICTSZ) 456 (bytes)
|
||||
|
||||
library:
|
||||
Section Headers:
|
||||
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
|
||||
[74] .gnu.liblist GNU_LIBLIST 0000000000000000 249940 000014 14 75 0 4
|
||||
|
||||
|
||||
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
|
||||
|
||||
|
||||
Thanks,
|
||||
Jan
|
||||
|
||||
|
||||
2010-03-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* symfile.c (addr_info_make_relative): New variable sect_name, use it.
|
||||
Do not warn on ".gnu.liblist" and ".gnu.conflict".
|
||||
|
||||
--- a/gdb/symfile.c
|
||||
+++ b/gdb/symfile.c
|
||||
@@ -597,7 +597,8 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
|
||||
|
||||
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
|
||||
{
|
||||
- asection *sect = bfd_get_section_by_name (abfd, addrs->other[i].name);
|
||||
+ const char *sect_name = addrs->other[i].name;
|
||||
+ asection *sect = bfd_get_section_by_name (abfd, sect_name);
|
||||
|
||||
if (sect)
|
||||
{
|
||||
@@ -614,8 +615,16 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
|
||||
}
|
||||
else
|
||||
{
|
||||
- warning (_("section %s not found in %s"), addrs->other[i].name,
|
||||
- bfd_get_filename (abfd));
|
||||
+ /* These two sections are intentionally loaded into memory from
|
||||
+ the DYNAMIC segment and so they have both SEC_ALLOC and SEC_LOAD
|
||||
+ set in the main executable (not in the library files). They
|
||||
+ are not present in the separate debug info file, though. */
|
||||
+
|
||||
+ if (!(strcmp (sect_name, ".gnu.liblist") == 0
|
||||
+ || strcmp (sect_name, ".gnu.conflict") == 0))
|
||||
+ warning (_("section %s not found in %s"), sect_name,
|
||||
+ bfd_get_filename (abfd));
|
||||
+
|
||||
addrs->other[i].addr = 0;
|
||||
|
||||
/* SECTINDEX is invalid if ADDR is zero. */
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
http://sourceware.org/ml/gdb-patches/2010-03/msg00868.html
|
||||
Subject: [patch] PIE: Fix back re-run [Re: [patch] svr4_exec_displacement success indicator]
|
||||
|
||||
Hi,
|
||||
|
||||
currently:
|
||||
|
||||
$ echo 'main(){}'|gcc -o 1 -fPIE -pie -x c -; ./gdb -nx -ex 'set disable-randomization off' -ex 'b main' -ex r -ex c -ex r ./1
|
||||
Breakpoint 1 at 0x6b0
|
||||
Starting program: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/1
|
||||
Breakpoint 1, 0x00007fbf73e8c6b0 in main ()
|
||||
Continuing.
|
||||
Program exited with code 0140.
|
||||
Starting program: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/1
|
||||
Error in re-setting breakpoint 1: Cannot access memory at address 0x7fbf73e8c6ac
|
||||
|
||||
It is since:
|
||||
[patch] svr4_exec_displacement success indicator [Re: PIE question]
|
||||
http://sourceware.org/ml/gdb-patches/2010-03/msg00336.html
|
||||
|
||||
|
||||
On Mon, 08 Mar 2010 22:53:58 +0100, Jan Kratochvil wrote:
|
||||
> Attached these changes:
|
||||
>
|
||||
> * svr4_exec_displacement calling convention should have success indicator.
|
||||
>
|
||||
> * Preserving now section_offsets if they are already set, inspired by
|
||||
> init_objfile_sect_indices.
|
||||
>
|
||||
> I believe either of parts would be sufficient for this problem.
|
||||
|
||||
The first part has caused the regression for PIE on native x86* GNU/Linux host.
|
||||
|
||||
As I believe for Daniel J.'s seen regression of `qOffsets' the second already
|
||||
checked-in part is sufficient - I would like to remove the first part.
|
||||
|
||||
OK to check it in?
|
||||
|
||||
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
|
||||
|
||||
(I do not think one needs to think about 7.1-branch as it is not a regression
|
||||
against any FSF GDB release.)
|
||||
|
||||
|
||||
Thanks,
|
||||
Jan
|
||||
|
||||
|
||||
gdb/
|
||||
2010-03-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Fix re-run of PIE executable.
|
||||
* solib-svr4.c (svr4_relocate_main_executable) <symfile_objfile>: Remove
|
||||
the part of pre-set SYMFILE_OBJFILE->SECTION_OFFSETS.
|
||||
|
||||
gdb/testsuite/
|
||||
2010-03-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Fix re-run of PIE executable.
|
||||
* gdb.base/break-interp.exp (test_ld): Turn off "disable-randomization".
|
||||
Remove $displacement_main to match the solib-svr4.c change. New "kill"
|
||||
and re-"run" of the inferior.
|
||||
|
||||
--- a/gdb/solib-svr4.c
|
||||
+++ b/gdb/solib-svr4.c
|
||||
@@ -1791,17 +1791,10 @@ svr4_relocate_main_executable (void)
|
||||
{
|
||||
CORE_ADDR displacement;
|
||||
|
||||
- if (symfile_objfile)
|
||||
- {
|
||||
- int i;
|
||||
-
|
||||
- /* Remote target may have already set specific offsets by `qOffsets'
|
||||
- which should be preferred. */
|
||||
-
|
||||
- for (i = 0; i < symfile_objfile->num_sections; i++)
|
||||
- if (ANOFFSET (symfile_objfile->section_offsets, i) != 0)
|
||||
- return;
|
||||
- }
|
||||
+ /* SYMFILE_OBJFILE->SECTION_OFFSETS may now contain displacement from the
|
||||
+ previous run of the inferior. Re-set it according to the current value,
|
||||
+ if we can find it out. But otherwise keep it as for remote target it may
|
||||
+ have been pre-set by the `qOffsets' packet. */
|
||||
|
||||
if (! svr4_exec_displacement (&displacement))
|
||||
return;
|
||||
--- a/gdb/testsuite/gdb.base/break-interp.exp
|
||||
+++ b/gdb/testsuite/gdb.base/break-interp.exp
|
||||
@@ -416,25 +416,28 @@ proc test_ld {file ifmain trynosym displacement} {
|
||||
# Print the "PIE (Position Independent Executable) displacement" message.
|
||||
gdb_test "set verbose on"
|
||||
|
||||
+ # A bit better test coverage.
|
||||
+ gdb_test "set disable-randomization off"
|
||||
+
|
||||
reach "dl_main" "run segv" $displacement
|
||||
|
||||
gdb_test "bt" "#0 +\[^\r\n\]*\\mdl_main\\M.*" "dl bt"
|
||||
|
||||
if $ifmain {
|
||||
# Displacement message will be printed the second time on initializing
|
||||
- # the linker from svr4_special_symbol_handling. If any ANOFFSET has
|
||||
- # been already set as non-zero the detection will no longer be run.
|
||||
- if {$displacement == "NONZERO"} {
|
||||
- set displacement_main "NONE"
|
||||
- } else {
|
||||
- set displacement_main $displacement
|
||||
- }
|
||||
- reach "main" continue $displacement_main
|
||||
+ # the linker from svr4_special_symbol_handling.
|
||||
+ reach "main" continue $displacement
|
||||
|
||||
reach "libfunc" continue "NONE"
|
||||
|
||||
gdb_test "bt" "#0 +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#1 +\[^\r\n\]*\\mmain\\M.*" "main bt"
|
||||
+ }
|
||||
|
||||
+ # Try re-run if the new PIE displacement takes effect.
|
||||
+ gdb_test "kill" "" "kill" {Kill the program being debugged\? \(y or n\) } "y"
|
||||
+ reach "dl_main" "run segv" $displacement
|
||||
+
|
||||
+ if $ifmain {
|
||||
test_core $file $displacement
|
||||
|
||||
test_attach $file $displacement
|
||||
|
|
@ -0,0 +1,704 @@
|
|||
http://sourceware.org/ml/gdb-cvs/2010-03/msg00104.html
|
||||
5855954454f19a801f76bbf7baafd11a693c5d33
|
||||
|
||||
Imported to sync gdb.base/break-interp.exp for gdb-pie-rerun.patch.
|
||||
|
||||
### src/gdb/ChangeLog 2010/03/11 03:45:48 1.11469
|
||||
### src/gdb/ChangeLog 2010/03/11 22:07:00 1.11470
|
||||
## -1,3 +1,9 @@
|
||||
+2010-03-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
+
|
||||
+ * solib-svr4.c (LM_ADDR_CHECK) <info_verbose>: Use printf_unfiltered
|
||||
+ for the PIC displacement, print also the displacement value.
|
||||
+ (svr4_exec_displacement): Print DISPLACEMENT if INFO_VERBOSE.
|
||||
+
|
||||
2010-03-10 Kevin Buettner <kevinb@redhat.com>
|
||||
|
||||
* remote-mips.c (close_ports, mips_initialize_cleanups)
|
||||
--- src/gdb/solib-svr4.c 2010/03/10 20:55:44 1.129
|
||||
+++ src/gdb/solib-svr4.c 2010/03/11 22:07:02 1.130
|
||||
@@ -243,12 +243,10 @@
|
||||
l_addr = l_dynaddr - dynaddr;
|
||||
|
||||
if (info_verbose)
|
||||
- {
|
||||
- warning (_(".dynamic section for \"%s\" "
|
||||
- "is not at the expected address"), so->so_name);
|
||||
- warning (_("difference appears to be caused by prelink, "
|
||||
- "adjusting expectations"));
|
||||
- }
|
||||
+ printf_unfiltered (_("Using PIC (Position Independent Code) "
|
||||
+ "prelink displacement %s for \"%s\".\n"),
|
||||
+ paddress (target_gdbarch, l_addr),
|
||||
+ so->so_name);
|
||||
}
|
||||
else
|
||||
warning (_(".dynamic section for \"%s\" "
|
||||
@@ -1767,6 +1765,18 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ if (info_verbose)
|
||||
+ {
|
||||
+ /* It can be printed repeatedly as there is no easy way to check
|
||||
+ the executable symbols/file has been already relocated to
|
||||
+ displacement. */
|
||||
+
|
||||
+ printf_unfiltered (_("Using PIE (Position Independent Executable) "
|
||||
+ "displacement %s for \"%s\".\n"),
|
||||
+ paddress (target_gdbarch, displacement),
|
||||
+ bfd_get_filename (exec_bfd));
|
||||
+ }
|
||||
+
|
||||
*displacementp = displacement;
|
||||
return 1;
|
||||
}
|
||||
### src/gdb/testsuite/ChangeLog 2010/03/11 00:20:29 1.2168
|
||||
### src/gdb/testsuite/ChangeLog 2010/03/11 22:07:02 1.2169
|
||||
## -1,3 +1,20 @@
|
||||
+2010-03-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
+
|
||||
+ * gdb.base/break-interp.exp: Create new displacement parameter value
|
||||
+ for the test_ld calls.
|
||||
+ (reach): New parameter displacement, verify its content. New push of
|
||||
+ pf_prefix "reach-$func:". Import global expect_out.
|
||||
+ (test_core): New parameter displacement, verify its content. New push
|
||||
+ of pf_prefix "core:". New command "set verbose on". Import global
|
||||
+ expect_out.
|
||||
+ (test_attach): New parameter displacement, verify its content. New
|
||||
+ push of pf_prefix "attach:". New command "set verbose on". Import
|
||||
+ global expect_out.
|
||||
+ (test_ld): New parameter displacement, pass it to the reach, test_core
|
||||
+ and test_attach calls and verify its content in the "ld.so exit" test.
|
||||
+ * gdb.base/prelink.exp: Remove gdb_exit and final return.
|
||||
+ (prelink): Update expected text, use gdb_test.
|
||||
+
|
||||
2010-03-10 Doug Evans <dje@google.com>
|
||||
|
||||
* gdb.base/checkpoint.exp: Fix comment.
|
||||
--- src/gdb/testsuite/gdb.base/break-interp.exp 2010/01/27 20:53:22 1.6
|
||||
+++ src/gdb/testsuite/gdb.base/break-interp.exp 2010/03/11 22:07:03 1.7
|
||||
@@ -221,30 +221,61 @@
|
||||
}
|
||||
|
||||
# `runto' does not check we stopped really at the function we specified.
|
||||
-proc reach {func command} {
|
||||
- global gdb_prompt
|
||||
+# DISPLACEMENT can be "NONE", "ZERO" or "NONZERO"
|
||||
+proc reach {func command displacement} {
|
||||
+ global gdb_prompt expect_out
|
||||
+
|
||||
+ global pf_prefix
|
||||
+ set old_ldprefix $pf_prefix
|
||||
+ lappend pf_prefix "reach-$func:"
|
||||
|
||||
if [gdb_breakpoint $func allow-pending] {
|
||||
- set test "reach $func"
|
||||
+ set test "reach"
|
||||
+ set test_displacement "seen displacement message as $displacement"
|
||||
gdb_test_multiple $command $test {
|
||||
+ -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
|
||||
+ # Missing "$gdb_prompt $" is intentional.
|
||||
+ if {$expect_out(1,string) == "0x0"} {
|
||||
+ set case "ZERO"
|
||||
+ } else {
|
||||
+ set case "NONZERO"
|
||||
+ }
|
||||
+ if {$displacement == $case} {
|
||||
+ pass $test_displacement
|
||||
+ # Permit multiple such messages.
|
||||
+ set displacement "FOUND-$displacement"
|
||||
+ } elseif {$displacement != "FOUND-$case"} {
|
||||
+ fail $test_displacement
|
||||
+ }
|
||||
+ exp_continue
|
||||
+ }
|
||||
-re "Breakpoint \[0-9\]+, $func \\(.*\\) at .*:\[0-9\]+\r\n.*$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
- -re "Breakpoint \[0-9\]+, \[0-9xa-f\]+ in $func \\(\\)( from .*)?\r\n$gdb_prompt $" {
|
||||
+ -re "Breakpoint \[0-9\]+, \[0-9xa-f\]+ in $func \\(\\)( from .*)?\r\n$gdb_prompt $" {
|
||||
pass $test
|
||||
}
|
||||
}
|
||||
+ if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
|
||||
+ fail $test_displacement
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ set pf_prefix $old_ldprefix
|
||||
}
|
||||
|
||||
-proc test_core {file} {
|
||||
- global srcdir subdir gdb_prompt
|
||||
+proc test_core {file displacement} {
|
||||
+ global srcdir subdir gdb_prompt expect_out
|
||||
|
||||
set corefile [core_find $file {} "segv"]
|
||||
if {$corefile == ""} {
|
||||
return
|
||||
}
|
||||
|
||||
+ global pf_prefix
|
||||
+ set old_ldprefix $pf_prefix
|
||||
+ lappend pf_prefix "core:"
|
||||
+
|
||||
gdb_exit
|
||||
gdb_start
|
||||
# Clear it to never find any separate debug infos in $debug_root.
|
||||
@@ -252,14 +283,44 @@
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load $file
|
||||
|
||||
- # Do not check the binary filename as it may be truncated.
|
||||
- gdb_test "core-file $corefile" "Core was generated by .*\r\n#0 .*" "core loaded"
|
||||
+ # Print the "PIE (Position Independent Executable) displacement" message.
|
||||
+ gdb_test "set verbose on"
|
||||
+
|
||||
+ set test "core loaded"
|
||||
+ set test_displacement "seen displacement message"
|
||||
+ gdb_test_multiple "core-file $corefile" $test {
|
||||
+ -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
|
||||
+ # Missing "$gdb_prompt $" is intentional.
|
||||
+ if {$expect_out(1,string) == "0x0"} {
|
||||
+ set case "ZERO"
|
||||
+ } else {
|
||||
+ set case "NONZERO"
|
||||
+ }
|
||||
+ if {$displacement == $case} {
|
||||
+ pass $test_displacement
|
||||
+ # Permit multiple such messages.
|
||||
+ set displacement "FOUND-$displacement"
|
||||
+ } elseif {$displacement != "FOUND-$case"} {
|
||||
+ fail $test_displacement
|
||||
+ }
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ -re "Core was generated by .*\r\n#0 .*$gdb_prompt $" {
|
||||
+ # Do not check the binary filename as it may be truncated.
|
||||
+ pass $test
|
||||
+ }
|
||||
+ }
|
||||
+ if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
|
||||
+ fail $test_displacement
|
||||
+ }
|
||||
|
||||
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "core main bt"
|
||||
+
|
||||
+ set pf_prefix $old_ldprefix
|
||||
}
|
||||
|
||||
-proc test_attach {file} {
|
||||
- global board_info
|
||||
+proc test_attach {file displacement} {
|
||||
+ global board_info gdb_prompt expect_out
|
||||
|
||||
gdb_exit
|
||||
|
||||
@@ -287,17 +348,61 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ global pf_prefix
|
||||
+ set old_ldprefix $pf_prefix
|
||||
+ lappend pf_prefix "attach:"
|
||||
+
|
||||
gdb_exit
|
||||
gdb_start
|
||||
- gdb_test "attach $pid" "Attaching to process $pid\r\n.*" "attach"
|
||||
+
|
||||
+ # Print the "PIE (Position Independent Executable) displacement" message.
|
||||
+ gdb_test "set verbose on"
|
||||
+
|
||||
+ set test "attach"
|
||||
+ gdb_test_multiple "attach $pid" $test {
|
||||
+ -re "Attaching to process $pid\r\n" {
|
||||
+ # Missing "$gdb_prompt $" is intentional.
|
||||
+ pass $test
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ set test "attach final prompt"
|
||||
+ set test_displacement "seen displacement message"
|
||||
+ gdb_test_multiple "" $test {
|
||||
+ -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
|
||||
+ # Missing "$gdb_prompt $" is intentional.
|
||||
+ if {$expect_out(1,string) == "0x0"} {
|
||||
+ set case "ZERO"
|
||||
+ } else {
|
||||
+ set case "NONZERO"
|
||||
+ }
|
||||
+ if {$displacement == $case} {
|
||||
+ pass $test_displacement
|
||||
+ # Permit multiple such messages.
|
||||
+ set displacement "FOUND-$displacement"
|
||||
+ } elseif {$displacement != "FOUND-$case"} {
|
||||
+ fail $test_displacement
|
||||
+ }
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ -re "$gdb_prompt $" {
|
||||
+ pass $test
|
||||
+ }
|
||||
+ }
|
||||
+ if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
|
||||
+ fail $test_displacement
|
||||
+ }
|
||||
+
|
||||
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "attach main bt"
|
||||
gdb_exit
|
||||
|
||||
remote_exec host "kill -9 $pid"
|
||||
+
|
||||
+ set pf_prefix $old_ldprefix
|
||||
}
|
||||
|
||||
-proc test_ld {file ifmain trynosym} {
|
||||
- global srcdir subdir gdb_prompt
|
||||
+proc test_ld {file ifmain trynosym displacement} {
|
||||
+ global srcdir subdir gdb_prompt expect_out
|
||||
|
||||
# First test normal `file'-command loaded $FILE with symbols.
|
||||
|
||||
@@ -308,20 +413,31 @@
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load $file
|
||||
|
||||
- reach "dl_main" "run segv"
|
||||
+ # Print the "PIE (Position Independent Executable) displacement" message.
|
||||
+ gdb_test "set verbose on"
|
||||
+
|
||||
+ reach "dl_main" "run segv" $displacement
|
||||
|
||||
gdb_test "bt" "#0 +\[^\r\n\]*\\mdl_main\\M.*" "dl bt"
|
||||
|
||||
if $ifmain {
|
||||
- reach "main" continue
|
||||
+ # Displacement message will be printed the second time on initializing
|
||||
+ # the linker from svr4_special_symbol_handling. If any ANOFFSET has
|
||||
+ # been already set as non-zero the detection will no longer be run.
|
||||
+ if {$displacement == "NONZERO"} {
|
||||
+ set displacement_main "NONE"
|
||||
+ } else {
|
||||
+ set displacement_main $displacement
|
||||
+ }
|
||||
+ reach "main" continue $displacement_main
|
||||
|
||||
- reach "libfunc" continue
|
||||
+ reach "libfunc" continue "NONE"
|
||||
|
||||
gdb_test "bt" "#0 +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#1 +\[^\r\n\]*\\mmain\\M.*" "main bt"
|
||||
|
||||
- test_core $file
|
||||
+ test_core $file $displacement
|
||||
|
||||
- test_attach $file
|
||||
+ test_attach $file $displacement
|
||||
}
|
||||
|
||||
if !$trynosym {
|
||||
@@ -341,18 +457,21 @@
|
||||
gdb_test "set debug-file-directory"
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
|
||||
+ # Print the "PIE (Position Independent Executable) displacement" message.
|
||||
+ gdb_test "set verbose on"
|
||||
+
|
||||
# Test no (error) message has been printed by `exec-file'.
|
||||
set escapedfile [string_to_regexp $file]
|
||||
gdb_test "exec-file $file" "exec-file $escapedfile" "load"
|
||||
|
||||
if $ifmain {
|
||||
- reach "dl_main" run
|
||||
+ reach "dl_main" run $displacement
|
||||
|
||||
set test "info files"
|
||||
set entrynohex ""
|
||||
gdb_test_multiple $test $test {
|
||||
-re "\r\n\[\t \]*Entry point:\[\t \]*0x(\[0-9a-f\]+)\r\n.*$gdb_prompt $" {
|
||||
- set entrynohex $expect_out(1,string)
|
||||
+ set entrynohex $expect_out(1,string)
|
||||
pass $test
|
||||
}
|
||||
}
|
||||
@@ -363,7 +482,34 @@
|
||||
} else {
|
||||
# There is no symbol to break at ld.so. Moreover it can exit with an
|
||||
# error code.
|
||||
- gdb_test "run" "Program exited (normally|with code \[0-9\]+)\\." "ld.so exit"
|
||||
+
|
||||
+ set test "ld.so exit"
|
||||
+ set test_displacement "seen displacement message"
|
||||
+ gdb_test_multiple "run" $test {
|
||||
+ -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
|
||||
+ # Missing "$gdb_prompt $" is intentional.
|
||||
+ if {$expect_out(1,string) == "0x0"} {
|
||||
+ set case "ZERO"
|
||||
+ } else {
|
||||
+ set case "NONZERO"
|
||||
+ }
|
||||
+ if {$displacement == $case} {
|
||||
+ pass $test_displacement
|
||||
+ # Permit multiple such messages.
|
||||
+ set displacement "FOUND-$displacement"
|
||||
+ } elseif {$displacement != "FOUND-$case"} {
|
||||
+ fail $test_displacement
|
||||
+ }
|
||||
+ exp_continue
|
||||
+ }
|
||||
+ -re "Program exited (normally|with code \[0-9\]+)\\.\r\n$gdb_prompt $" {
|
||||
+ # Do not check the binary filename as it may be truncated.
|
||||
+ pass $test
|
||||
+ }
|
||||
+ }
|
||||
+ if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
|
||||
+ fail $test_displacement
|
||||
+ }
|
||||
}
|
||||
|
||||
set pf_prefix $old_ldprefix
|
||||
@@ -450,7 +596,12 @@
|
||||
if ![prelink$ldprelink $interp] {
|
||||
continue
|
||||
}
|
||||
- test_ld $interp 0 [expr {$ldsepdebug == "NO"}]
|
||||
+ if {$ldprelink == "NO"} {
|
||||
+ set displacement "NONZERO"
|
||||
+ } else {
|
||||
+ set displacement "ZERO"
|
||||
+ }
|
||||
+ test_ld $interp 0 [expr {$ldsepdebug == "NO"}] $displacement
|
||||
|
||||
if ![copy $interp $interp_saved] {
|
||||
continue
|
||||
@@ -531,7 +682,14 @@
|
||||
|
||||
if {[prelink$binprelink "--dynamic-linker=$interp --ld-library-path=$dir $exec $interp [concat $dests]" [file tail $exec]]
|
||||
&& [copy $interp_saved $interp]} {
|
||||
- test_ld $exec 1 [expr {$binsepdebug == "NO"}]
|
||||
+ if {$binpie == "NO"} {
|
||||
+ set displacement "NONE"
|
||||
+ } elseif {$binprelink == "NO"} {
|
||||
+ set displacement "NONZERO"
|
||||
+ } else {
|
||||
+ set displacement "ZERO"
|
||||
+ }
|
||||
+ test_ld $exec 1 [expr {$binsepdebug == "NO"}] $displacement
|
||||
}
|
||||
}
|
||||
}
|
||||
--- src/gdb/testsuite/gdb.base/prelink.exp 2010/02/13 12:02:29 1.11
|
||||
+++ src/gdb/testsuite/gdb.base/prelink.exp 2010/03/11 22:07:03 1.12
|
||||
@@ -112,15 +112,4 @@
|
||||
# Print the "adjusting expectations" message.
|
||||
gdb_test "set verbose on"
|
||||
|
||||
-set test "prelink"
|
||||
-global gdb_prompt
|
||||
-gdb_test_multiple "core-file $objdir/$subdir/prelink.core" "$test" {
|
||||
- -re "warning: \.dynamic section.*not at the expected address.*warning: difference.*caused by prelink, adjusting expectations.*$gdb_prompt $" {
|
||||
- pass "$test"
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-gdb_exit
|
||||
-
|
||||
-return 0
|
||||
-
|
||||
+gdb_test "core-file $objdir/$subdir/prelink.core" {Using PIC \(Position Independent Code\) prelink displacement.*} "prelink"
|
||||
|
||||
|
||||
|
||||
http://sourceware.org/ml/gdb-cvs/2010-03/msg00066.html
|
||||
16558457783d71e2856ff2b9ceaa83199d2d9811
|
||||
|
||||
### src/gdb/ChangeLog 2010/03/08 07:45:49 1.11442
|
||||
### src/gdb/ChangeLog 2010/03/08 08:32:49 1.11443
|
||||
## -1,3 +1,8 @@
|
||||
+2010-03-08 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
+
|
||||
+ * symfile.c (addr_info_make_relative): New variable sect_name, use it.
|
||||
+ Do not warn on ".gnu.liblist" and ".gnu.conflict".
|
||||
+
|
||||
2010-03-08 Joel Brobecker <brobecker@adacore.com>
|
||||
|
||||
Memory error when reading wrong core file.
|
||||
--- src/gdb/symfile.c 2010/03/05 19:32:44 1.275
|
||||
+++ src/gdb/symfile.c 2010/03/08 08:32:49 1.276
|
||||
@@ -592,7 +592,8 @@
|
||||
|
||||
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
|
||||
{
|
||||
- asection *sect = bfd_get_section_by_name (abfd, addrs->other[i].name);
|
||||
+ const char *sect_name = addrs->other[i].name;
|
||||
+ asection *sect = bfd_get_section_by_name (abfd, sect_name);
|
||||
|
||||
if (sect)
|
||||
{
|
||||
@@ -609,8 +610,22 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- warning (_("section %s not found in %s"), addrs->other[i].name,
|
||||
- bfd_get_filename (abfd));
|
||||
+ /* This section does not exist in ABFD, which is normally
|
||||
+ unexpected and we want to issue a warning.
|
||||
+
|
||||
+ However, the ELF prelinker does create a couple of sections
|
||||
+ (".gnu.liblist" and ".gnu.conflict") which are marked in the main
|
||||
+ executable as loadable (they are loaded in memory from the
|
||||
+ DYNAMIC segment) and yet are not present in separate debug info
|
||||
+ files. This is fine, and should not cause a warning. Shared
|
||||
+ libraries contain just the section ".gnu.liblist" but it is not
|
||||
+ marked as loadable there. */
|
||||
+
|
||||
+ if (!(strcmp (sect_name, ".gnu.liblist") == 0
|
||||
+ || strcmp (sect_name, ".gnu.conflict") == 0))
|
||||
+ warning (_("section %s not found in %s"), sect_name,
|
||||
+ bfd_get_filename (abfd));
|
||||
+
|
||||
addrs->other[i].addr = 0;
|
||||
|
||||
/* SECTINDEX is invalid if ADDR is zero. */
|
||||
|
||||
|
||||
|
||||
http://sourceware.org/ml/gdb-cvs/2010-03/msg00138.html
|
||||
http://sourceware.org/ml/gdb-patches/2010-03/msg00535.html
|
||||
cc3e71651e2fd0168a2d3dd4efc2d3e15fd508dd
|
||||
|
||||
### src/gdb/ChangeLog 2010/03/15 03:48:46 1.11479
|
||||
### src/gdb/ChangeLog 2010/03/15 09:31:30 1.11480
|
||||
## -1,3 +1,8 @@
|
||||
+2010-03-15 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
+
|
||||
+ * symfile.c (addr_info_make_relative): Ignore also missing ".dynbss"
|
||||
+ and ".sdynbss". Update the comment.
|
||||
+
|
||||
2010-03-15 Jie Zhang <jie@codesourcery.com>
|
||||
|
||||
* MAINTAINERS: Update my email address.
|
||||
--- src/gdb/symfile.c 2010/03/10 18:20:07 1.277
|
||||
+++ src/gdb/symfile.c 2010/03/15 09:31:34 1.278
|
||||
@@ -576,16 +576,19 @@
|
||||
/* This section does not exist in ABFD, which is normally
|
||||
unexpected and we want to issue a warning.
|
||||
|
||||
- However, the ELF prelinker does create a couple of sections
|
||||
- (".gnu.liblist" and ".gnu.conflict") which are marked in the main
|
||||
- executable as loadable (they are loaded in memory from the
|
||||
- DYNAMIC segment) and yet are not present in separate debug info
|
||||
- files. This is fine, and should not cause a warning. Shared
|
||||
- libraries contain just the section ".gnu.liblist" but it is not
|
||||
- marked as loadable there. */
|
||||
+ However, the ELF prelinker does create a few sections which are
|
||||
+ marked in the main executable as loadable (they are loaded in
|
||||
+ memory from the DYNAMIC segment) and yet are not present in
|
||||
+ separate debug info files. This is fine, and should not cause
|
||||
+ 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. */
|
||||
|
||||
if (!(strcmp (sect_name, ".gnu.liblist") == 0
|
||||
- || strcmp (sect_name, ".gnu.conflict") == 0))
|
||||
+ || strcmp (sect_name, ".gnu.conflict") == 0
|
||||
+ || strcmp (sect_name, ".dynbss") == 0
|
||||
+ || strcmp (sect_name, ".sdynbss") == 0))
|
||||
warning (_("section %s not found in %s"), sect_name,
|
||||
bfd_get_filename (abfd));
|
||||
|
||||
|
||||
|
||||
|
||||
http://sourceware.org/ml/gdb-patches/2010-03/msg00799.html
|
||||
Subject: [patch] Fix separate-debug with non-unique section names (PR 11409)
|
||||
|
||||
A different version was checked-in but they are interchangeable:
|
||||
http://sourceware.org/ml/gdb-patches/2010-03/msg00799.html
|
||||
http://sourceware.org/ml/gdb-cvs/2010-03/msg00241.html
|
||||
|
||||
Hi,
|
||||
|
||||
gdb-7.1 is now broken for example for debugging /usr/bin/emacs due to:
|
||||
http://sourceware.org/bugzilla/show_bug.cgi?id=11409
|
||||
[22] .data PROGBITS 00000000007fe8a0 1fe8a0 215068 00 WA 0 0 32
|
||||
[23] .data PROGBITS 0000000000a13920 413920 68c6e0 00 WA 0 0 32
|
||||
|
||||
It is in fact a regression against gdb-7.0 by me due to:
|
||||
|
||||
commit 71d0069a9f238a11f7f455bf6ad2adfc25683521
|
||||
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Tue Jan 5 15:51:01 2010 +0000
|
||||
|
||||
gdb/
|
||||
* symfile.c (syms_from_objfile): Remove the !MAINLINE conditional.
|
||||
|
||||
as while the code was broken even before the broken relocation was not applied
|
||||
to mainline binary (before PIE+OSX patches went in).
|
||||
|
||||
|
||||
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
|
||||
|
||||
OK to check-in also for gdb-7.1 (7.1.1)?
|
||||
|
||||
|
||||
Thanks,
|
||||
Jan
|
||||
|
||||
|
||||
gdb/
|
||||
2010-03-23 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* symfile.c (addr_info_make_relative): Move sect declaration to the
|
||||
outer block. Initialize it to NULL. Prefer SECT->next more than
|
||||
bfd_get_section_by_name.
|
||||
|
||||
gdb/testsuite/
|
||||
2010-03-23 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.base/dup-sect.exp, gdb.base/dup-sect.S: New.
|
||||
|
||||
--- a/gdb/symfile.c
|
||||
+++ b/gdb/symfile.c
|
||||
@@ -529,6 +529,7 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
|
||||
asection *lower_sect;
|
||||
CORE_ADDR lower_offset;
|
||||
int i;
|
||||
+ asection *sect;
|
||||
|
||||
/* Find lowest loadable section to be used as starting point for
|
||||
continguous sections. */
|
||||
@@ -553,11 +554,23 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
|
||||
(the loadable section directly below it in memory).
|
||||
this_offset = lower_offset = lower_addr - lower_orig_addr */
|
||||
|
||||
+ sect = NULL;
|
||||
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
|
||||
{
|
||||
const char *sect_name = addrs->other[i].name;
|
||||
- asection *sect = bfd_get_section_by_name (abfd, sect_name);
|
||||
|
||||
+ /* Prefer the next section of that we have found last. The separate
|
||||
+ debug info files have either the same section layout or just a few
|
||||
+ sections are missing there. On the other hand the section name is not
|
||||
+ unique and we could find an inappropraite section by its name. */
|
||||
+
|
||||
+ if (sect)
|
||||
+ sect = sect->next;
|
||||
+ 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);
|
||||
if (sect)
|
||||
{
|
||||
/* This is the index used by BFD. */
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/dup-sect.S
|
||||
@@ -0,0 +1,22 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ 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 <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+ .section sect1, "a"
|
||||
+var1: .byte 1
|
||||
+
|
||||
+ .section sect2, "a"
|
||||
+var2: .byte 2
|
||||
--- /dev/null
|
||||
+++ b/gdb/testsuite/gdb.base/dup-sect.exp
|
||||
@@ -0,0 +1,79 @@
|
||||
+# This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+# 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 <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+# Test inappropriate offseting of multiple sections with the same name.
|
||||
+# When kept in object file (before final executable link) it still works.
|
||||
+# When separate debug info file is not used it still works.
|
||||
+# When the ELF symbol table is kept in the main binary it still works.
|
||||
+# Used .S file as in .c file we would need __attriute__((section)) which is
|
||||
+# a GCC extension.
|
||||
+
|
||||
+# This test can only be run on targets which support ELF and use gas.
|
||||
+# For now pick a sampling of likely targets.
|
||||
+if {![istarget *-*-linux*]
|
||||
+ && ![istarget *-*-gnu*]
|
||||
+ && ![istarget *-*-elf*]
|
||||
+ && ![istarget arm-*-eabi*]
|
||||
+ && ![istarget powerpc-*-eabi*]} {
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+set testfile dup-sect
|
||||
+set srcfile ${testfile}.S
|
||||
+set srcmainfile start.c
|
||||
+set executable ${testfile}
|
||||
+set binfile ${objdir}/${subdir}/${executable}
|
||||
+
|
||||
+if {[build_executable ${testfile}.exp $executable [list ${srcfile} ${srcmainfile}] {}] == -1} {
|
||||
+ return -1
|
||||
+}
|
||||
+
|
||||
+set test "rename section"
|
||||
+set objcopy_program [transform objcopy]
|
||||
+set result [catch "exec $objcopy_program --rename-section sect2=sect1 $binfile" output]
|
||||
+verbose "result is $result"
|
||||
+verbose "output is $output"
|
||||
+if {$result != 0} {
|
||||
+ fail $test
|
||||
+ return
|
||||
+}
|
||||
+pass $test
|
||||
+
|
||||
+set test "split"
|
||||
+if {[gdb_gnu_strip_debug $binfile] != 0} {
|
||||
+ fail $test
|
||||
+} else {
|
||||
+ pass $test
|
||||
+}
|
||||
+
|
||||
+# gdb_gnu_strip_debug uses only --strip-debug and keeps the ELF symbol table
|
||||
+# in $binfile.
|
||||
+set test "strip"
|
||||
+set strip_program [transform strip]
|
||||
+set result [catch "exec $strip_program $binfile" output]
|
||||
+verbose "result is $result"
|
||||
+verbose "output is $output"
|
||||
+if {$result != 0} {
|
||||
+ fail $test
|
||||
+ return
|
||||
+}
|
||||
+pass $test
|
||||
+
|
||||
+clean_restart $executable
|
||||
+
|
||||
+gdb_test "p/d *(const char *) &var1" " = 1" "var1 after strip"
|
||||
+gdb_test "p/d *(const char *) &var2" " = 2" "var2 after strip"
|
||||
|
21
gdb.spec
21
gdb.spec
|
@ -32,18 +32,18 @@ Name: gdb%{?_with_debug:-debug}
|
|||
# Set version to contents of gdb/version.in.
|
||||
# NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3
|
||||
# and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch).
|
||||
Version: 7.0.90.20100312
|
||||
Version: 7.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: 24%{?_with_upstream:.upstream}%{dist}
|
||||
Release: 1%{?_with_upstream:.upstream}%{dist}
|
||||
|
||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain
|
||||
Group: Development/Debuggers
|
||||
# Do not provide URL for snapshots as the file lasts there only for 2 days.
|
||||
# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{version}.tar.bz2
|
||||
# ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2
|
||||
Source: gdb-%{version}.tar.bz2
|
||||
Source: ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2
|
||||
Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
URL: http://gnu.org/software/gdb/
|
||||
|
||||
|
@ -241,7 +241,7 @@ Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch
|
|||
Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
|
||||
|
||||
# Backported fixups post the source tarball.
|
||||
#Patch232: gdb-upstream.patch
|
||||
Patch232: gdb-upstream.patch
|
||||
|
||||
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
|
||||
Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch
|
||||
|
@ -423,12 +423,12 @@ Patch417: gdb-bz541866-rwatch-before-run.patch
|
|||
# Remove false gdb_assert on $sp underflow.
|
||||
Patch422: gdb-infcall-sp-underflow.patch
|
||||
|
||||
# Fix false warning: section .gnu.liblist not found in ...
|
||||
Patch425: gdb-false-warning-gnu.liblist.patch
|
||||
|
||||
# Fix double-free on std::terminate handler (Tom Tromey, BZ 562975).
|
||||
Patch429: gdb-bz562975-std-terminate-double-free.patch
|
||||
|
||||
# PIE: Fix back re-reun.
|
||||
Patch430: gdb-pie-rerun.patch
|
||||
|
||||
BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
|
||||
Requires: readline%{?_isa}
|
||||
BuildRequires: readline-devel%{?_isa}
|
||||
|
@ -564,7 +564,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
|
|||
|
||||
%if 0%{!?_with_upstream:1}
|
||||
|
||||
#patch232 -p1
|
||||
%patch232 -p1
|
||||
%patch349 -p1
|
||||
%patch420 -p1
|
||||
%patch124 -p1
|
||||
|
@ -677,8 +677,8 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
|
|||
%patch412 -p1
|
||||
%patch417 -p1
|
||||
%patch422 -p1
|
||||
%patch425 -p1
|
||||
%patch429 -p1
|
||||
%patch430 -p1
|
||||
|
||||
%patch415 -p1
|
||||
%patch393 -p1
|
||||
|
@ -1011,6 +1011,9 @@ fi
|
|||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Mar 25 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-1.fc13
|
||||
- Update to new FSF GDB release.
|
||||
|
||||
* Mon Mar 15 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.90.20100312-24.fc13
|
||||
- Drop gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch having false symbols
|
||||
resolving (related to BZ 573277).
|
||||
|
|
Loading…
Reference in New Issue