Page MenuHomeFreeBSD

Add an implementation of .mcount on arm64.
ClosedPublic

Authored by andrew on Mar 22 2022, 4:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 9:17 PM
Unknown Object (File)
Thu, Nov 7, 9:16 PM
Unknown Object (File)
Thu, Nov 7, 9:14 PM
Unknown Object (File)
Sun, Oct 27, 2:26 PM
Unknown Object (File)
Thu, Oct 24, 12:33 PM
Unknown Object (File)
Sep 30 2024, 1:38 PM
Unknown Object (File)
Sep 29 2024, 11:55 PM
Unknown Object (File)
Sep 29 2024, 11:54 PM
Subscribers

Details

Summary

To support cc -pg on arm64 we need to implement .mcount. As clang and
gcc think it is function like it just needs to load the arguments
to _mcount and call it.

On gcc the first argument is passed in x0, however this is missing on
clang so we need to load it from the stack. As it's the caller return
address this will be at a known location.

PR: 262709

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44856
Build 41744: arc lint + arc unit

Event Timeline

Add a comment on where frompc comes from

lib/libc/aarch64/Symbol.map
14

I guess adding this to FBSD_1.0 (rather than FBSD_1.7) is appropriate given that this is existing functionality that was just missing from arm64's entry.

Looks OK to me. I think it's worth a comment or commit message note with what we discussed on IRC with respect to caller-saved registers.

This revision is now accepted and ready to land.Mar 22 2022, 6:48 PM
This revision was automatically updated to reflect the committed changes.