
On 2009 Feb 5, at 11:24, Gwern Branwen wrote:
On 2009 Feb 4, at 20:39, Gwern Branwen wrote:
On Wed, Feb 4, 2009 at 7:51 PM, Don Stewart
wrote: How portable?
By a funny coincidence, I was messing with strip a few days ago (for yi), and my discussion with dcoutts covered just this.
He told me that -optl-s was considered bad, as that option gets passed to the linker and -s is apparently specific to GNU ld.
Er? ld -s has worked since Version 7 UNIX. Or is this about e.g. Cygwin/mingw not implementing it?07:02:19 <dcoutts> gwern: -s is specific to the GNU linker I think. So
On Thu, Feb 5, 2009 at 10:43 AM, Brandon S. Allbery KF8NH
wrote: probably does not work on OSX, BSD, Solaris.
Solaris: -s Strips symbolic information from the output file. Any debugging information, that is, .line, .debug*, and .stab* sections, and their associated relocation entries are removed. Except for relocatable files, a symbol table SHT_SYMTAB and its associated string table section are not created in the output object file. See also -z redlocsym. FreeBSD, NetBSD: uses GNU ld OSX 10.5: -s Completely strip the output, including removing the symbol table. This file format variant is no longer supported. This option is obsolete. So we do have a portability issue, thanks to Apple changing a bunch of stuff relating to linking and object files in Leopard. But: strip no longer removes relocation entries under any condition. Instead, it updates the external relocation entries (and indirect sym- bol table entries) to reflect the resulting symbol table. strip prints an error message for those symbols not in the resulting symbol table that are needed by an external relocation entry or an indirect symbol table. The link editor ld(1) is the only program that can strip relo- cation entries and know if it is safe to do so. which to me says that strip can break working programs and is not recommended --- so strip isn't safe either on OSX. And, for the record: from the 7th Research Edition manpages –s ‘Strip’ the output, that is, remove the symbol table and relocation bits to save space (but impair the usefulness of the debugger). This information can also be removed by strip(1). ld -s goes back a long ways. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH