Subject: Re: linking stripped object files
From: [email-masked] (Fergus Henderson)

3 Mar 1997 03:29:51 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Content-Type: text
Original-To: [email-masked] (Chin Chee-Kai)
Original-Cc: [email-masked] (gnu-win32)
In-Reply-To: <[email-masked]> from "Chin Chee-Kai" at Mar 3, 97 01:35:29 pm
X-Mailer: ELM [version 2.4 PL24]
Original-Sender: [email-masked]

Chin Chee-Kai, you wrote:
> 
> Suppose now I do this (which works on Unix, producing an executable
> that does not have debugging information):
> 	rm -f a.exe
> 	strip *.o
> 	gcc -g 1.o 2.o 3.o

Which Unix does this work on?

It doesn't work on Linux or Alpha/OSF.

On Alpha/OSF, the `strip' command reports the following:
	strip: Error: 1.o contains relocation entries-- not stripped

On Linux, you just get 

	undefined symbol `main'

or something like that.

> I get:
> C:\CYGNUS\H-I386-CYGWIN32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/\
> ../../../../i386-cygwin32/lib/libcygwin.a(libcmain.o): In function `main':
> /pizza/mushroom/noer/beta17/src/winsup/libcmain.cc:30: undefined reference \
> to `WinMain@16'

That's because `strip' stripped off all the symbols including the
`main' symbol in your `.o' file.

-- 
Fergus Henderson <[email-masked]>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger [email-masked]         |     -- the last words of T. S. Garp.
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".