Kernel Panic When Invoking Functions in Non-Standard Sections
Kernel Panic When Invoking Functions in Non-Standard Sections
- Subject: Kernel Panic When Invoking Functions in Non-Standard Sections
- From: Geoffrey Schmit <email@hidden>
- Date: Wed, 24 Sep 2003 14:02:36 -0500
If I compile a function into a section other than __text (i.e., using
__attribute__((section("__TEXT,__mysection"))) ) and invoke that
function when my kernel extension is loading, I get a kernel panic. If
I look at the contents of that function, using gdb, just before I jump
to its address, it is all zeros. It appears that not all sections are
loaded before the kernel extension is initialized. If I don't invoke
this function when the kernel extension is loading but, rather, wait and
invoke it after the kernel extension has loaded, a kernel panic does not
occur.
Should all sections be loaded before the kernel extension is
initialized? Is this observed behavior to be expected? If so, any
suggestions to work around this problem? (Yes, not compiling functions
into non-standard sections would work. However, doing so is currently
solving another problem. I'll pursue solving this other problem in
another way if there are no other options.)
Thanks!
geoff
--
Geoffrey Schmit
Senior Software Engineer
National Instruments
email@hidden
www.ni.com
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.