HomeFreeBSD

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

Description

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

  • 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.

Reviewed by: andrew
Obtained from: CheriBSD
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34416

(cherry picked from commit a6db407f15ab7d0dbfd83a48173343654106510e)

Details

Provenance
jhbAuthored on Mar 10 2022, 11:39 PM
Reviewer
andrew
Differential Revision
D34416: libpmcstat: Fix a few ARM-specific issues with function symbols.
Parents
rGed159d5f8839: bhyve: Remove VM_MAXCPU from the userspace API/ABI.
Branches
Unknown
Tags
Unknown