Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stripping IOKit kernel extensions



Hello,

I am trying to strip my IOKit driver and am running into problems. Spefically, kextload crashes (bus error) when it attempts to load the kext when I strip it. It loads fine without stripping. 

I found a discussion about this very issue in the archives, but I didn't see a resolution for the OP.

I have a symbols file which contains  _kmod_info, and all symbols for my driver (both static data and methods). When I strip the executable, I use strip -u -s <symbols.txt> <path to kext binary>. I get a nice trim binary that contains only _kmod_info and the following symbols (I've included their demanged form, but the symbols file contains the mangled names of course):
com_foo_bar_service_kext::gMetaClass
com_foo_bar_service_kext::superClass
com_foo_bar_service_kext::start(IOService*)
com_foo_bar_service_kext::MetaClass::MetaClass()
com_foo_bar_service_kext::MetaClass::MetaClass()
#com_foo_bar_service_kext::MetaClass::~MetaClass()
com_foo_bar_service_kext::metaClass
com_foo_bar_service_kext::terminate(unsigned long)
com_foo_bar_service_kext::com_foo_bar_service_kext(OSMetaClass const*)
com_foo_bar_service_kext::com_foo_bar_service_kext()
com_foo_bar_service_kext::com_foo_bar_service_kext(OSMetaClass const*)
com_foo_bar_service_kext::com_foo_bar_service_kext()
com_foo_bar_service_kext::~com_foo_bar_service_kext()
com_foo_bar_service_kext::~com_foo_bar_service_kext()
com_foo_bar_service_kext::getMetaClass() const
com_foo_bar_service_kext::MetaClass::alloc() const
vtable for com_foo_bar_service_kext
vtable for com_foo_bar_service_kext::MetaClass
 

I'm not sure what other symbols I need to include in the binary to prevent kextload from crashing. Is there a way to do this from Xcode? If not, what's the proper strip/nmedit command needed to do what is necessary? This is all on Tiger with Xcode 2.3.
 
Thanks,
Ryan

-- Ryan
email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.