• Remi Bernon's avatar
    perf symbols: Try reading the symbol table with libbfd · eac9a434
    Remi Bernon authored
    Wine generates PE binaries for its code modules and also generates debug
    files in PE or PDB formats, which perf cannot parse either.
    
    Trying to read symbols on non-ELF binaries with libbfd, when supported,
    makes it possible for perf to report symbols and annotations for Windows
    applications running under Wine.
    
    Because libbfd doesn't provide symbol size (probably because of some
    backends not supporting it), we compute it by first sorting the symbols
    by addresses and then considering that they are sequential in a given
    section.
    
    v3: Also include local and weak bfd symbols and mark them as such, only
        global symbols were previously reported, and that caused a very
        imprecise address to symbol resolution.
    Signed-off-by: default avatarRemi Bernon <rbernon@codeweavers.com>
    Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Jacek Caban <jacek@codeweavers.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: http://lore.kernel.org/lkml/20200821165238.1340315-2-rbernon@codeweavers.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    eac9a434
symbol.h 7.97 KB