Re: How to tell whether an executable supports GC?
Re: How to tell whether an executable supports GC?
- Subject: Re: How to tell whether an executable supports GC?
- From: André Pang <email@hidden>
- Date: Sat, 9 Aug 2008 11:32:30 +1000
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:
This email sent to email@hidden