Mailing Lists: Apple Mailing Lists

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

Re: How to tell whether an executable supports GC?



On 08/08/2008, at 3:18 PM, Chris Suter wrote:

You want to look at the __image_info section in the __OBJC segment:

struct objc_image_info  {
 uint32_t	version;	// initially 0
 uint32_t	flags;
};

#define OBJC_IMAGE_SUPPORTS_GC   2
#define OBJC_IMAGE_GC_ONLY       4

Thanks for the heads-up Chris! Thanks to your tip, I settled for a rather cheap solution that works just fine for me:


/usr/bin/otool -o $PATH | grep -q -2 '__OBJC.__image_info' | grep GC

:)

I'm not 100% sure that otool's installed without the BSD subsystem being available, but I think that's mandatory now with Leopard. The GC check is just used for displaying some extra informative text in a sheet (which plugins aren't GC supported), so if anything fails, it's not a disaster. I figured it'd be easier than trying to find some libraries to read in the Mach-O format... considering the tininess of the problem, it was far too much effort!


-- % Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >How to tell whether an executable supports GC? (From: AndrĂ© Pang <email@hidden>)
 >Re: How to tell whether an executable supports GC? (From: "Chris Suter" <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.