Page MenuHomeFreeBSD

libpmcstat: Fix a few ARM-specific issues with function symbols.
ClosedPublic

Authored by jhb on Mar 2 2022, 11:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 1, 8:12 AM
Unknown Object (File)
Mon, Sep 30, 9:04 AM
Unknown Object (File)
Mon, Sep 23, 7:08 PM
Unknown Object (File)
Sun, Sep 22, 9:14 AM
Unknown Object (File)
Sun, Sep 22, 9:13 AM
Unknown Object (File)
Sat, Sep 21, 3:33 PM
Unknown Object (File)
Fri, Sep 20, 7:27 AM
Unknown Object (File)
Thu, Sep 19, 2:17 AM
Subscribers

Details

Summary
  • Refine the checks for ARM mapping symbols and apply them on arm64 as well as 32-bit arm. In particular, mapping symbols can have additional characters and are not strictly limited to just "$a" but can append additional characters (e.g. "$a.1"). Add "$x" to the list of mapping symbol prefixes.
  • Clear the LSB of function symbol addresses. Thumb function addresses set the LSB to enable Thumb mode. However, the actual function starts at the aligned address with LSB clear. Not clearing the LSB can cause pmcannotate to pass misaligned addresses to objdump when extracting disassembly.

Obtained from: CheriBSD
Sponsored by: University of Cambridge, Google, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Mar 2 2022, 11:07 PM
jhb created this revision.

I actually tested this on Morello which also sets the LSB to enable capability decoding mode similar to Thumb rather than Thumb. Morello also adds an additional type of mapping symbol ($c.<mumble>).

This revision is now accepted and ready to land.Mar 7 2022, 4:07 PM