diff options
| author | Mark Wielaard <[email protected]> | 2013-01-16 15:19:32 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2013-01-22 16:09:18 +0100 |
| commit | 5083a70d3b64946fa47ea5766943a15a3ecc6891 (patch) | |
| tree | f819878e1fade1faf29ac7c9fe0288df529760ec /libdwfl/dwfl_module.c | |
| parent | 6d258ceb8dbf41e255397ed0db7d7635f398134c (diff) | |
libdwfl: Add minisymtab support.
Add an auxiliary symbol table dwfl_file aux_sym to Dwfl_Module if all we
have is the dynsym table. The main file might contain a .gnu_debugdata
section. The .gnu_debugdata section is a compressed embedded ELF file
that contains the text (code) section symbols from the symtab table
that are not in the main file dynsym table. dwfl_module_getsymtab (),
dwfl_module_addrsym () and dwfl_module_getsym () will use the auxiliary
symbol table when available (and no full symtab is available from the
debug file).
* libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata,
aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global.
(dwfl_adjusted_aux_sym_addr): New function.
(dwfl_deadjust_aux_sym_addr): Likewise.
(dwfl_adjusted_st_value): Take and check symfile argument.
(dwfl_deadjust_st_value): Likewise.
* dwfl_module_getdwarf.c (find_prelink_address_sync): Take and
use dwfl_file as argument to set address_sync.
(find_debuginfo): Call find_prelink_address_sync with debug file.
(find_aux_sym): New function.
(find_symtab): Use find_aux_sym if all we have is the dynsym table
and fill in aux DwflModule fields.
(dwfl_module_getsymtab): Return syments plus aux_syments.
(load_symtab): Always set first_global.
* dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile
when using same_section. Calculate first_global based on both
mod->first_global and mod->aux_first_global.
* dwfl_module.c (__libdwfl_module_free): Free aux_sym.
* dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table
to retrieve symbol and name if necessary, making sure all locals
from any table come before any globals.
* dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value
with symfile.
* relocate.c (resolve_symbol): Likewise.
https://fedoraproject.org/wiki/Features/MiniDebugInfo
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdwfl/dwfl_module.c')
| -rw-r--r-- | libdwfl/dwfl_module.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libdwfl/dwfl_module.c b/libdwfl/dwfl_module.c index e703d27e..f914b3a3 100644 --- a/libdwfl/dwfl_module.c +++ b/libdwfl/dwfl_module.c @@ -79,6 +79,7 @@ __libdwfl_module_free (Dwfl_Module *mod) if (mod->debug.elf != mod->main.elf) free_file (&mod->debug); free_file (&mod->main); + free_file (&mod->aux_sym); if (mod->build_id_bits != NULL) free (mod->build_id_bits); |
