From: cheekai AT gen DOT co DOT jp (Chin Chee-Kai) Subject: Re: linking stripped object files 3 Mar 1997 05:33:03 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: Reply-To: Chin Chee-Kai Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII X-Authentication-Warning: gatekeeper.gen.co.jp: smap set sender to using -f Original-To: Fergus Henderson Original-Cc: gnu-win32 In-Reply-To: <199703030759.SAA32338@murlibobo.cs.mu.OZ.AU> Original-Sender: owner-gnu-win32 AT cygnus DOT com Hmm, seems like it's different on different machines (?). I'm running gcc version 2.7.2 on SGI Indy IRIX 6.2. Running "strip" alone forbids stripping due to IRIX's "strip"'s behavior. It provides a "-f" which I used to strip all ELF and non-ELF object files. After which, gcc-ing again still produces the executable. I've included a transcript below (filenames, include paths and library paths are changed and removed, others remain in tact). --------------------------- BEGIN OF TRANSCRIPT --------------------------- % make gcc -I. -g -c 1.c cc1: warning: `-g' not supported by this configuration of GCC gcc -I. -g -c 2.c cc1: warning: `-g' not supported by this configuration of GCC gcc -I. -g -c 3.c cc1: warning: `-g' not supported by this configuration of GCC gcc -I. -g -L. 1.o 2.o 3.o -o final ld: WARNING 84: /usr/local/lib/gcc-lib/mips-sgi-irix5.3/2.7.2/libgcc.a is not used for resolving any symbol. ld: WARNING 84: /usr/local/lib/gcc-lib/mips-sgi-irix5.3/2.7.2/libgcc.a is not used for resolving any symbol. final: Symflags set but there are none? % ls -lF final -rwx------ 1 cheekai users 54344 Mar 3 17:03 final* % rm final % ls -lF *.o -rw------- 1 cheekai users 39420 Mar 3 17:03 1.o -rw------- 1 cheekai users 13956 Mar 3 17:03 2.o -rw------- 1 cheekai users 30884 Mar 3 17:03 3.o % strip *.o strip: 1.o: Not stripped. Only elf type (e_type) ET_EXEC files are stripped unless -f is specified. This one is ET_REL strip: 2.o: Not stripped. Only elf type (e_type) ET_EXEC files are stripped unless -f is specified. This one is ET_REL strip: 3.o: Not stripped. Only elf type (e_type) ET_EXEC files are stripped unless -f is specified. This one is ET_REL % strip -f *.o % ls -lF *.o -rw------- 1 cheekai users 23480 Mar 3 17:03 1.o -rw------- 1 cheekai users 8064 Mar 3 17:03 2.o -rw------- 1 cheekai users 15560 Mar 3 17:03 3.o % make etelnet gcc -I. -g -L. 1.o 2.o 3.o -o final ld: WARNING 84: /usr/local/lib/gcc-lib/mips-sgi-irix5.3/2.7.2/libgcc.a is not used for resolving any symbol. ld: WARNING 84: /usr/local/lib/gcc-lib/mips-sgi-irix5.3/2.7.2/libgcc.a is not used for resolving any symbol. final: Symflags set but there are none? % ls -lF final -rwx------ 1 cheekai users 39268 Mar 3 17:03 final* % gcc -v Reading specs from /usr/local/lib/gcc-lib/mips-sgi-irix5.3/2.7.2/specs gcc version 2.7.2 % ---------------------------- END OF TRANSCRIPT ---------------------------- Chin Chee-Kai (Last, First) Internet Email-ID: cheekai AT gen DOT co DOT jp On Mon, 3 Mar 1997, Fergus Henderson wrote: > > [...my quotation deleted...] > > 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. > > > [...my quotation deleted...] > > That's because `strip' stripped off all the symbols including the > `main' symbol in your `.o' file. > > -- > Fergus Henderson | "I have always known that the pursuit > WWW: | of excellence is a lethal habit" > PGP: finger fjh AT 128 DOT 250 DOT 37 DOT 3 | -- the last words of T. S. Garp. - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".