diff options
author | Daniel Jacobowitz <drow@false.org> | 2008-05-14 18:14:34 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2008-05-14 18:14:34 +0000 |
commit | 2eaf8d2a141aefdad8ad7f61c9a9f84a38019044 (patch) | |
tree | b71b0af640d0fabda31752ade90b5ba5c4192bf3 /gdb/elfread.c | |
parent | 86a4952b1461aa668cb0fd55ececbb691eefdb12 (diff) | |
download | gdb-2eaf8d2a141aefdad8ad7f61c9a9f84a38019044.zip gdb-2eaf8d2a141aefdad8ad7f61c9a9f84a38019044.tar.gz gdb-2eaf8d2a141aefdad8ad7f61c9a9f84a38019044.tar.bz2 |
* elfread.c (elf_symtab_read): Create trampolines for @plt symbols.
* minsyms.c (lookup_minimal_symbol_by_pc_section_1): Renamed from
lookup_minimal_symbol_by_pc_section. Prefer trampolines if requested.
(lookup_minimal_symbol_by_pc_section): Use
lookup_minimal_symbol_by_pc_section_1.
(lookup_solib_trampoline_symbol_by_pc): Likewise.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r-- | gdb/elfread.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index 76af9dc..363702a 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -521,6 +521,33 @@ elf_symtab_read (struct objfile *objfile, int type, if (msym != NULL) msym->filename = filesymname; gdbarch_elf_make_msymbol_special (gdbarch, sym, msym); + + /* For @plt symbols, also record a trampoline to the + destination symbol. The @plt symbol will be used in + disassembly, and the trampoline will be used when we are + trying to find the target. */ + if (msym && ms_type == mst_text && type == ST_SYNTHETIC) + { + int len = strlen (sym->name); + + if (len > 4 && strcmp (sym->name + len - 4, "@plt") == 0) + { + char *base_name = alloca (len - 4 + 1); + struct minimal_symbol *mtramp; + + memcpy (base_name, sym->name, len - 4); + base_name[len - 4] = '\0'; + mtramp = record_minimal_symbol (base_name, symaddr, + mst_solib_trampoline, + sym->section, objfile); + if (mtramp) + { + MSYMBOL_SIZE (mtramp) = MSYMBOL_SIZE (msym); + mtramp->filename = filesymname; + gdbarch_elf_make_msymbol_special (gdbarch, sym, mtramp); + } + } + } } } } |