• Samuel Huang's avatar
    [SuperSize] Demangle .Lswitch.table. symbols, and deduce their object_paths. · 9a357d6d
    Samuel Huang authored
    LLD creates '.Lswitch.table._Z...' symbols, which llvm-cxxfilt does not
    properly demangle. This CL solves this problem. Details:
    * Updates demangle.py to detect and demangle these symbols:
      * E.g., '.Lswitch.table._Z3foov' is demangled to
        'Switch table for foo()', which then becomes
        'foo() [Switch table]' downstream.
    * Applies agrieve@'s idea to use the demangled names of switch tables
      to deduce object_path if missing (happens most of the time), by
      looking up the object_path of the symbol for the containing function.
      * Caveat: Some switch table symbols have suffices like ' (.123)',
        which need to be stripped.
      * For ~5% of cases for Chrome (with thin-LTO) there are multiple
        matching functions with different object files. For this, we
        simply arbitrate and take the first one found.
    
    Bug: 923936
    Change-Id: I30a6cdaabee2191b197ef05a643d704574e50344
    Reviewed-on: https://chromium-review.googlesource.com/c/1481744
    Commit-Queue: Samuel Huang <huangs@chromium.org>
    Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#634630}
    9a357d6d
archive.py 64.6 KB