Re: Finding symbols in loaded kexts
Re: Finding symbols in loaded kexts
- Subject: Re: Finding symbols in loaded kexts
- From: Quinn <email@hidden>
- Date: Tue, 7 Aug 2007 09:41:13 +0100
At 10:15 -0700 6/8/07, Michael Smith wrote:
On Aug 6, 2007, at 9:58 AM, Andrew Gallatin wrote:
If the symbol is not global, but still present, would it work to call
it via a function pointer initialized to the correct address? Eg,
does the "global" property mean anything once the module is relocated?
All that "global" means is that it's available to modules linking
with it, in this context.
Actually... you have to be careful about this, at least on Intel
32-bit, at least in user space. If you declare a function to be
"static", the compiler knows all of the callers and is free to adjust
the parameter passing to its own ends. I've seen this happen on
Intel 32-bit, where the compiler decides to ignore the standard
calling conventions and pass some parameters in registers. Calling
such a function via a function pointer (or, indeed, from GDB, which
is how I tripped over this) is a way to a dusty (and confusing) death.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden