From 24c274a1338fdc8295f85a2a4854cfa80a1712da Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 22 Feb 2013 23:24:24 +0000 Subject: * elfread.c (elf_symtab_read): Do not use udata.p here to find symbol size. * ppc64-tdep.c (ppc64_elf_make_msymbol_special): New function. * ppc64-tdep.h (ppc64_elf_make_msymbol_special): Declare. * ppc-linux-tdep.c (ppc_linux_init_abi): Set up to use the above. * ppcfbsd-tdep.c (ppcfbsd_init_abi): Likewise. --- gdb/ppc64-tdep.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gdb/ppc64-tdep.c') diff --git a/gdb/ppc64-tdep.c b/gdb/ppc64-tdep.c index 9c3616a1a27..f636b4d450b 100644 --- a/gdb/ppc64-tdep.c +++ b/gdb/ppc64-tdep.c @@ -22,6 +22,7 @@ #include "gdbcore.h" #include "ppc-tdep.h" #include "ppc64-tdep.h" +#include "elf-bfd.h" /* Macros for matching instructions. Note that, since all the operands are masked off before they're or-ed into the instruction, @@ -361,3 +362,17 @@ ppc64_convert_from_func_ptr_addr (struct gdbarch *gdbarch, return addr; } + +/* A synthetic 'dot' symbols on ppc64 has the udata.p entry pointing + back to the original ELF symbol it was derived from. Get the size + from that symbol. */ + +void +ppc64_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym) +{ + if ((sym->flags & BSF_SYNTHETIC) != 0 && sym->udata.p != NULL) + { + elf_symbol_type *elf_sym = (elf_symbol_type *) sym->udata.p; + SET_MSYMBOL_SIZE (msym, elf_sym->internal_elf_sym.st_size); + } +} -- cgit v1.2.1