Subject: Re: Is "-s" flag to ld(1) portable?
To: Bruce J.A. Nourish <email@example.com>
From: Greg A. Woods <firstname.lastname@example.org>
Date: 01/20/2004 03:57:33
[ On Monday, January 19, 2004 at 16:52:23 (-0700), Bruce J.A. Nourish wrote: ]
> Subject: Is "-s" flag to ld(1) portable?
FYI, I imagine it will help more folks to read your message if you
repeat your subject line in the body of your message. ;-)
As for your question, well, yes, I'd say so. I seem to remember some
rather ancient, esoteric, and definitely non-GCC (i.e. pre-GCC :-)
compilers that only supported a separate "strip" command, but in more
standard Unix circles "ld -s" is good back to at least V7 (including
SysVr2.2). My copy of the Mark Williams C86 compiler for MS/DOS doesn't
support '-s' for either "cc" or "ld", but it does have a "strip"
command. I don't think you have to worry about supporting MWC86 though,
I hope. :-)
Note that in POSIX (2001), "c99 -s" is standard (and before that in ISO
C-1989 "c89 -s" was also standard and slightly before that SuSv2 also
specified "cc -s" for the same purpose). "ld" isn't specified by POSIX.
(FYI I'm having a damn hard time finding a working non-GCC based
compiler on any modern posix-ish system to do some portability testing.
Very few people I know these days seem to run "proprietary" systems and
even less of them shelled out extra for their vendor's compiler.)
Greg A. Woods
+1 416 218-0098 VE3TCP RoboHack <email@example.com>
Planix, Inc. <firstname.lastname@example.org> Secrets of the Weird <email@example.com>