• pierre.langlois's avatar
    [perf-prof] Fix erroneous code offsets in unwinding info · 21f064fc
    pierre.langlois authored
    The unwinding information we emit wrongly encodes code locations as relative
    offsets. If we look at the .eh_frame section of shared object generated by "perf
    inject" using "objdump -g":
    
    ~~~
    00000000 0000000000000018 00000000 CIE
    (snip)
    0000001c 0000000000000028 00000020 FDE cie=00000000 pc=fffffffffffffee8..00000000000017f8
    (snip)
    00000048 ZERO terminator
    ~~~
    
    We can see the range that the FDE entry covers is incorrect, it should point to
    where the .text section is, at address 0x40 on a 64-bit architecture.
    
    The reason for this was that the PerfJitLogger logs a code size that is
    different from the one we've used when encoding the unwinding information. The
    logger will ignore the safepoint table while the unwinding info assumes it is
    part of the code.
    
    BUG=
    
    Review-Url: https://codereview.chromium.org/2790403002
    Cr-Commit-Position: refs/heads/master@{#44378}
    21f064fc
code-generator.cc 38.6 KB