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)
Apr 17 2024, 4:03 PM
Unknown Object (File)
Apr 16 2024, 1:59 AM
Unknown Object (File)
Mar 12 2024, 3:26 PM
Unknown Object (File)
Mar 8 2024, 7:24 AM
Unknown Object (File)
Jan 12 2024, 12:25 AM
Unknown Object (File)
Dec 20 2023, 8:09 AM
Unknown Object (File)
Dec 4 2023, 1:53 AM
Unknown Object (File)
Oct 11 2023, 9:44 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