aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-04-26 13:01:27 +0100
committerPedro Alves <palves@redhat.com>2018-04-26 13:08:01 +0100
commit1adeb822668d3bd7182ca9b8cf42a7261deb3c7f (patch)
tree7a54ed0fc3d7db7bd91203c5e1441a63cc6340fb /gdb
parent42ddae103c9eb20fb87378548ee95b4bd23648a5 (diff)
downloadgdb-1adeb822668d3bd7182ca9b8cf42a7261deb3c7f.zip
gdb-1adeb822668d3bd7182ca9b8cf42a7261deb3c7f.tar.gz
gdb-1adeb822668d3bd7182ca9b8cf42a7261deb3c7f.tar.bz2
For PPC64: elf_gnu_ifunc_record_cache: handle plt symbols in .text section
elf_gnu_ifunc_record_cache doesn't ever record anything on PPC64 (tested on gcc110 on the compile farm, CentOS 7.4, ELFv1), because that expects to find PLT symbols in the .plt section, while there we get: (gdb) info symbol 'gnu_ifunc@plt' gnu_ifunc@plt in section .text ^^^^^ I guess that may be related to the comment in ppc-linux-tdep.c that says "For secure PLT, stub is in .text". In any case, this commit fixes the issue by making the function look at the symbol name instead of at the section. gdb/ChangeLog: 2018-04-26 Pedro Alves <palves@redhat.com> * elfread.c (elf_gnu_ifunc_record_cache): Check if the symbol name ends in "@plt" instead of looking at the symbol's section.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/elfread.c14
2 files changed, 13 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d10252e..4fa5bbc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2018-04-26 Pedro Alves <palves@redhat.com>
+ * elfread.c (elf_gnu_ifunc_record_cache): Check if the symbol name
+ ends in "@plt" instead of looking at the symbol's section.
+
+2018-04-26 Pedro Alves <palves@redhat.com>
+
* blockframe.c (cache_pc_function_is_gnu_ifunc): Delete. Remove
all references.
(find_pc_partial_function_gnu_ifunc): Rename to ...
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 42a2c92..82437f8 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -680,7 +680,6 @@ static int
elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr)
{
struct bound_minimal_symbol msym;
- asection *sect;
struct objfile *objfile;
htab_t htab;
struct elf_gnu_ifunc_cache entry_local, *entry_p;
@@ -691,14 +690,17 @@ elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr)
return 0;
if (BMSYMBOL_VALUE_ADDRESS (msym) != addr)
return 0;
- /* minimal symbols have always SYMBOL_OBJ_SECTION non-NULL. */
- sect = MSYMBOL_OBJ_SECTION (msym.objfile, msym.minsym)->the_bfd_section;
objfile = msym.objfile;
/* If .plt jumps back to .plt the symbol is still deferred for later
- resolution and it has no use for GDB. Besides ".text" this symbol can
- reside also in ".opd" for ppc64 function descriptor. */
- if (strcmp (bfd_get_section_name (objfile->obfd, sect), ".plt") == 0)
+ resolution and it has no use for GDB. */
+ const char *target_name = MSYMBOL_LINKAGE_NAME (msym.minsym);
+ size_t len = strlen (target_name);
+
+ /* Note we check the symbol's name instead of checking whether the
+ symbol is in the .plt section because some systems have @plt
+ symbols in the .text section. */
+ if (len > 4 && strcmp (target_name + len - 4, "@plt") == 0)
return 0;
htab = (htab_t) objfile_data (objfile, elf_objfile_gnu_ifunc_cache_data);