aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-04-17 18:38:46 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-04-17 18:38:46 +0000
commit63524580f8372e38a6a62fd875a4252068c31150 (patch)
tree56284f865a15b9e590b606102dc1a086ba876571 /gdb/elfread.c
parent90359a167375927982fc3f675718044a491da759 (diff)
downloadgdb-63524580f8372e38a6a62fd875a4252068c31150.zip
gdb-63524580f8372e38a6a62fd875a4252068c31150.tar.gz
gdb-63524580f8372e38a6a62fd875a4252068c31150.tar.bz2
bfd/
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Do not check for SEC_LOAD. gdb/ Fix convert_code_addr_to_desc_addr for ppc64 files after eu-strip. * elfread.c (elf_symfile_read): New variable synth_abfd, pass it to bfd_get_synthetic_symtab. * jit.c (jit_register_code): Pass NULL to the new parameter parent. * machoread.c (macho_add_oso_symfile): Pass main_objfile to the new parameter parent, remove the call to add_separate_debug_objfile. * solib.c (solib_read_symbols): Pass NULL to the new parameter parent. * symfile-mem.c (symbol_file_add_from_memory): Likewise. * symfile.c (symbol_file_add_with_addrs_or_offsets): New parameter parent, new comment for it, call add_separate_debug_objfile for it. (symbol_file_add_separate): Pass objfile as the parameter parent, remove the call to add_separate_debug_objfile. (symbol_file_add_from_bfd): New parameter parent, pass it. (symbol_file_add): Pass NULL to the new parameter parent. * symfile.h (symbol_file_add_from_bfd): New parameter parent. gdb/testsuite/ * gdb.base/eu-strip-infcall.c: New file. * gdb.base/eu-strip-infcall.exp: New file.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 2d589a4..f691b8f 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1234,7 +1234,7 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
static void
elf_symfile_read (struct objfile *objfile, int symfile_flags)
{
- bfd *abfd = objfile->obfd;
+ bfd *synth_abfd, *abfd = objfile->obfd;
struct elfinfo ei;
struct cleanup *back_to;
long symcount = 0, dynsymcount = 0, synthcount, storage_needed;
@@ -1305,9 +1305,26 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags)
elf_rel_plt_read (objfile, dyn_symbol_table);
}
+ /* Contrary to binutils --strip-debug/--only-keep-debug the strip command from
+ elfutils (eu-strip) moves even the .symtab section into the .debug file.
+
+ bfd_get_synthetic_symtab on ppc64 for each function descriptor ELF symbol
+ 'name' creates a new BSF_SYNTHETIC ELF symbol '.name' with its code
+ address. But with eu-strip files bfd_get_synthetic_symtab would fail to
+ read the code address from .opd while it reads the .symtab section from
+ a separate debug info file as the .opd section is SHT_NOBITS there.
+
+ With SYNTH_ABFD the .opd section will be read from the original
+ backlinked binary where it is valid. */
+
+ if (objfile->separate_debug_objfile_backlink)
+ synth_abfd = objfile->separate_debug_objfile_backlink->obfd;
+ else
+ synth_abfd = abfd;
+
/* Add synthetic symbols - for instance, names for any PLT entries. */
- synthcount = bfd_get_synthetic_symtab (abfd, symcount, symbol_table,
+ synthcount = bfd_get_synthetic_symtab (synth_abfd, symcount, symbol_table,
dynsymcount, dyn_symbol_table,
&synthsyms);
if (synthcount > 0)