Re: Suppressing LC_DATA_IN_CODE and LC_FUNCTION_STARTS load commands in kexts
Re: Suppressing LC_DATA_IN_CODE and LC_FUNCTION_STARTS load commands in kexts
- Subject: Re: Suppressing LC_DATA_IN_CODE and LC_FUNCTION_STARTS load commands in kexts
- From: Phil Jordan <email@hidden>
- Date: Fri, 21 Sep 2012 23:48:17 +0200
Hi Shantonu,
Thanks for the quick reply!
On Fri, Sep 21, 2012 at 10:06 PM, Shantonu Sen <email@hidden> wrote:
> Are you sure you are building with -mmacosx-version-min=10.7?
10.6 actually, though I've just tried with 10.7 and that doesn't help
either. (Neither does switching between the 10.8 and 10.7 base SDKs,
or between clang 4.1 and GCC-llvm)
It's very reproducible:
- create a new I/O Kit kext project
- change deployment target to 10.7 or below
- Architectures to 32/64-bit Intel
- either set "Build Active Architecture Only" to "No" or just build
the 32-bit version.
Even this minimal kext will have the two rogue segments:
LC_FUNCTION_STARTS is 8 bytes in this case, LC_DATA_IN_CODE zero, as
in my case. Doesn't matter if XCode 4.5 is running on Lion or Mountain
Lion.
> What is your full link line for your i386 kext?
XCode tells me the linker command line is:
"/Applications/Xcode
4.5.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
-arch i386 -isysroot "/Applications/Xcode
4.5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"
-L/Users/phillip/Library/Developer/Xcode/DerivedData/ssdcache-hcwibjofejcnjvgtslhyzwfqkkty/Build/Products/Debug
-F/Users/phillip/Library/Developer/Xcode/DerivedData/ssdcache-hcwibjofejcnjvgtslhyzwfqkkty/Build/Products/Debug
-filelist /Users/phillip/Library/Developer/Xcode/DerivedData/ssdcache-hcwibjofejcnjvgtslhyzwfqkkty/Build/Intermediates/ssdcache.build/Debug/ssdcache.build/Objects-normal/i386/ssdcache.LinkFileList
-mmacosx-version-min=10.6 -Xlinker -no_function_starts -Xlinker -kext
-nostdlib -lkmodc++
/Users/phillip/Library/Developer/Xcode/DerivedData/ssdcache-hcwibjofejcnjvgtslhyzwfqkkty/Build/Intermediates/ssdcache.build/Debug/ssdcache.build/Objects-normal/i386/ssdcache_info.o
-lkmod -lcc_kext -o
/Users/phillip/Library/Developer/Xcode/DerivedData/ssdcache-hcwibjofejcnjvgtslhyzwfqkkty/Build/Intermediates/ssdcache.build/Debug/ssdcache.build/Objects-normal/i386/ssdcache
The "-Xlinker -no_function_starts" is not normally there, of course.
Thanks,
phil
_______________________________________________
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