• Vasily Gorbik's avatar
    s390/decompressor: add symbols support · 24621896
    Vasily Gorbik authored
    Information printed by print_pgm_check_info() is crucial for
    debugging decompressor problems. Printing instruction addresses is
    better than nothing, but turns further debugging into tedious job of
    figuring out which function those addresses correspond to.
    
    This change adds simplistic symbols resolution support. And adds %pS
    format specifier support to decompressor_printk().
    
    Decompressor symbols list is extracted and sorted with
    nm -n -S:
    ...
    0000000000010000 0000000000000014 T startup
    0000000000010014 00000000000000b0 t startup_normal
    0000000000010180 00000000000000b2 t startup_kdump
    ...
    
    Then functions are filtered and contracted to a form:
    "10000 14 startup\0""10014 b0 startup_normal\0""10180 b2 startup_kdump\0"
    ...
    Which makes it trivial to find beginning of an entry and names are 0
    terminated, so could be used as is. Symbols are binary-searched.
    
    To get symbols list with final addresses and then get it into the
    decompressor's image the same trick as for kallsyms is used.
    Decompressor's vmlinux is linked twice.
    
    Symbols are stored in .decompressor.syms section, current size is about
    2kb.
    Reviewed-by: default avatarAlexander Egorenkov <egorenar@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    24621896
vmlinux.lds.S 1.99 KB