Mailing Lists: Apple Mailing Lists

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

dyld sources vs dyld binaries



Here is an excerpt of a backtrace on a call to NSCreateObjectFileImageFromMemory (ran on Mac OS X 10.4.6 ppc)
You can clearly identify that compatibilityChecks is called inside the ImageLoaderMachO constructor.


1 dyld 0x8fe1168c ImageLoaderMachO::compatibilityChecks(ImageLoader::LinkContext const&) + 316
2 dyld 0x8fe12ddc ImageLoaderMachO::ImageLoaderMachO [in-charge](char const*, mach_header const*, unsigned long long, ImageLoader::LinkContext const&) + 224
3 dyld 0x8fe05af4 dyld::loadFromMemory(unsigned char const*, unsigned long long, char const*) + 996
4 dyld 0x8fe0860c NSCreateObjectFileImageFromMemory + 120
5 libSystem.B.dylib 0x9017dca0 NSCreateObjectFileImageFromMemory + 104


Here is the source from http://www.opensource.apple.com/darwinsource/ 10.4.6.ppc/
// create image by copying an in-memory mach-o file
ImageLoaderMachO::ImageLoaderMachO(const char* moduleName, const struct mach_header* mh, uint64_t len, const LinkContext& context)
: ImageLoader(moduleName)
{
// clean slate
this->init();


	// temporary use this buffer until TEXT is mapped in
	fMachOData = (const uint8_t*)mh;

	// create segments
	this->instantiateSegments((const uint8_t*)mh);
	
	// map segments
	if ( mh->filetype != MH_EXECUTE )
		ImageLoader::mapSegments((const void*)mh, len, context);
	
	// get pointers to interesting things
	this->parseLoadCmds();
}

So, why is the binaries different from the sources ? Any idea ?
Grepping the dyld sources for "compatibilityChecks" returned no result either. I'm really surprised.


Cédric Lutthi _______________________________________________
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.