When I have to pull in hundreds of commits from upstream, I like to try to make sure things still compile - frequently, to try to limit how far I need to go to back fix things.
One issue is missing symbols in the kext, since you won't know until you try to load the kext. And loading the kext each commit is not realistic.
So I went and made up a call to something that does not exist, in my case, strqcmp(). I could not get the various tools like kmutil libraries --all-symbols to print out that this function was going to fail, so I wrote a little script (thanks ChatGPT);
./scripts/kpi_check.py --arch arm64e -k module/os/macos/zfs.kext/
First missing symbols:
_crfree
_crhold
_strqcmp
Hurrah.
But sadly, my brain was then curious as to why crhold() and crfree() work. Worked for years. Only dtrace calls them in XNU sources but otherwise not mentioned there, not listed in my frameworks, nm is not seeing it.
Somewhat of a rabbit hole.
I don't even need to know, it does work after all. I should just let it go right?
and yet... how does it work?
My best guess is a symbols.alias pointing it to kauth_cred_ref() somewhere? Maybe?
Anyway, pretty low priority but it's an itch...