Re: Finding symbols in loaded kexts
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com 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? 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... At 10:15 -0700 6/8/07, Michael Smith wrote: On Aug 6, 2007, at 9:58 AM, Andrew Gallatin wrote: 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Quinn