• 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: Recommendations for strip(1)? Was: gdb: "No line number info...."
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recommendations for strip(1)? Was: gdb: "No line number info...."


  • Subject: Re: Recommendations for strip(1)? Was: gdb: "No line number info...."
  • From: Alastair Houghton <email@hidden>
  • Date: Sun, 16 Aug 2009 16:40:00 +0100

On 16 Aug 2009, at 07:31, Jerry Krinock wrote:

I've not read enough to understand that yet. Does this weakness of strip(1) relative to stripping by ld(1) concern anyone?

I wouldn't worry too much about relocation entries. If it's talking about what I think it's talking about, they're there to let the loader load bits of your code at different addresses to the ones in the compiled binary, which is usually a desirable thing to be able to do. They shouldn't expose much information about your compiled binary (which is I assume why you want to strip it).


Also, if someone would like to share which of the half dozen or so "stripping strength" options of strip(1) are recommended for a plain old Cocoa application, and/or for private frameworks and helpers within such a Cocoa application, it would provide some nice data points :)

We pretty much just run strip with no options.

There is one fly in the ointment though; if you're using the Leopard linker and you are targeting 10.3, because the Leopard linker doesn't mark the .objc_class_name_ symbols as weak (unlike previous versions), you need to keep them or your otherwise 10.3-compatible program won't run on 10.3.

The fix is to do something like

nm <path-to-executable> | sed -n 's/[0-9a-f]* S \ (\.objc_class_name_.*\)/\1/p' > "$TEMP_DIR/symbols-to-keep"
strip -s "$TEMP_DIR/symbols-to-keep" <path-to-executable>


rather than just plain

  strip <path-to-executable>

Obviously if you don't care about 10.3, you don't need to bother with this complication.

Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Recommendations for strip(1)? Was: gdb: "No line number info...."
      • From: Jerry Krinock <email@hidden>
References: 
 >Recommendations for strip(1)? Was: gdb: "No line number info...." (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Unexpected NSManagedObject isInserted behavior in iPhone.
  • Next by Date: Re: ld errors when Cocoa app linking C++ via intermediate ObjC++ library
  • Previous by thread: Recommendations for strip(1)? Was: gdb: "No line number info...."
  • Next by thread: Re: Recommendations for strip(1)? Was: gdb: "No line number info...."
  • Index(es):
    • Date
    • Thread