Re: kld displacement too large error
You need to copy and paste the gcc flags that project builder uses by default for a kext into your static library target. Specifically in this case you are missing the -mlong-branch build flag. Godfrey At 12:28 -0400 2002-10-2, Michael Cashwell wrote: Greetings all, I've been trying to get my kext to work with a portion of it coming from a static library (containing C and C++ code). After considerable effort I finally have the kext building. But when I try to kextload it I get these obscure errors: [dhcp02:/System/Library/Extensions] cashwell% sudo kextload -t netShim.kext/ kextload: extension netShim.kext/ appears to be valid kld(): /System/Library/Extensions/netShim.kext/Contents/MacOS/netShim relocation overflow for relocation entry 32 in section (__TEXT,__text) (displacement too large) kld(): /System/Library/Extensions/netShim.kext/Contents/MacOS/netShim relocation overflow for relocation entry 53 in section (__TEXT,__text) (displacement too large) kld(): /System/Library/Extensions/netShim.kext/Contents/MacOS/netShim relocation overflow for relocation entry 58 in section (__TEXT,__text) (displacement too large) kextload: kld_load_from_memory() failed for module /System/Library/Extensions/netShim.kext/Contents/MacOS/netShim kextload: a link/load error occured for kernel extension netShim.kext/ load failed for extension netShim.kext/ I've tried "otool -r -v" on the executable but don't know how to interpret the output. Does anyone have clue what kld is complaining about here? How would I map the "entry numbers" in the error message to the otool output? (Are the decimal? Do they count from 0 or 1?, etc.) Perhaps there's some compiler or libtool option that I should be using to specify "wide" displacements when building either the library or the kext? Any clues would be appreciated. Thanks, Mike _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored. _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Godfrey van der Linden