• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to tell whether an executable supports GC?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to tell whether an executable supports GC?


  • Subject: Re: How to tell whether an executable supports GC?
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Sat, 9 Aug 2008 10:36:42 +0200

You can also create your own helper tool compiled with GC support and, that just preflight the bundle you pass as argument and return the result.
It's a little more works, but it's cleaner too.



Le 9 août 08 à 03:32, André Pang a écrit :

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


_______________________________________________

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


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>)
 >Re: How to tell whether an executable supports GC? (From: André Pang <email@hidden>)

  • Prev by Date: Using @selector()
  • Next by Date: Re: Using @selector()
  • Previous by thread: Re: How to tell whether an executable supports GC?
  • Next by thread: Re: How to tell whether an executable supports GC?
  • Index(es):
    • Date
    • Thread