64-bit signed kext doesn't work in older kernels

Originator:adri.sr.83
Number:rdar://13652235 Date Originated:15-Apr-2013 03:33 PM
Status:Duplicate Resolved:
Product:Xcode Product Version:4.6.2
Classification: Reproducible:yes
 
Summary:
Kernel extensions signed with codesign and latest Xcode (4.6.2 with matching Command Line Tools) won't work in older kernels (my test machine: (MacOS X Server 10.6 , Darwin kernel 10.8.0)

Steps to Reproduce:
1. Build a 64-bit or mixed kext with latest xcode.
2. sign with codesign or via xcode
3. on target system, load kext

Expected Results:
the kext is loaded and works

Actual Results:
The kext is not loaded. The following error message appears in system error log: 
xkld[com.mycompany.kext]: The Mach-O file is malformed: Invalid segment type in MH_OBJECT kext: 29
 
Regression:
- i386-only kext do work (signed as generic).
- x86_64 and mixed i386-x86_64 kexts don't work.

Notes:
i386 kexts are signed separately, not modifying the Mach-O binary. In all other combinations of architectures the binary is modified causing the load failure.
Its been discussed here: http://stackoverflow.com/questions/15657720/codesign-and-kernel-extension-kext-in-osx-wont-load

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!