]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdwfl: Add minisymtab support.
authorMark Wielaard <mjw@redhat.com>
Wed, 16 Jan 2013 14:19:32 +0000 (15:19 +0100)
committerMark Wielaard <mjw@redhat.com>
Tue, 22 Jan 2013 15:09:18 +0000 (16:09 +0100)
commit5083a70d3b64946fa47ea5766943a15a3ecc6891
treef819878e1fade1faf29ac7c9fe0288df529760ec
parent6d258ceb8dbf41e255397ed0db7d7635f398134c
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 <mjw@redhat.com>
libdwfl/ChangeLog
libdwfl/dwfl_module.c
libdwfl/dwfl_module_addrsym.c
libdwfl/dwfl_module_getdwarf.c
libdwfl/dwfl_module_getsym.c
libdwfl/dwfl_module_info.c
libdwfl/libdwflP.h
libdwfl/relocate.c