From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5952 invoked by alias); 19 Nov 2001 11:56:47 -0000 Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@sources.redhat.com Received: (qmail 5846 invoked from network); 19 Nov 2001 11:56:43 -0000 Received: from unknown (HELO pixelwww.pixelpower.com) (193.123.2.227) by sourceware.cygnus.com with SMTP; 19 Nov 2001 11:56:43 -0000 Received: from exchangeserver.pixelpower.com (exchangeserver.pixelpower.com) by pixelwww.pixelpower.com (Content Technologies SMTPRS 4.2.1) with ESMTP id ; Mon, 19 Nov 2001 11:55:36 +0000 Received: by exchangeserver.pixelpower.com with Internet Mail Service (5.5.2650.21) id ; Mon, 19 Nov 2001 12:00:34 -0000 Message-ID: <718D38CAB6E0D011B2C90060970C28A57E1AB8@exchangeserver.pixelpower.com> From: David Korn To: 'Mohammad Saleem' Cc: crossgcc@sources.redhat.com, cygwin@cygwin.com Subject: RE: linking application with a library Date: Sun, 11 Nov 2001 08:26:00 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-SW-Source: 2001-11/txt/msg00586.txt.bz2 -----Original Message----- >From: Mohammad Saleem [mailto:mosa@enea.se] >Sent: 18 November 2001 11:46 Hiya Mohammad, I can see a couple of things here: >Even with link I tried with a flag --gc-sections D'oh, yes, sorry, I should have mentioned that one. >test.srec: $(OBJ) appcon.o > $(LD) --gc-sections $(LDFLAGS) $^ mylib.a $(LIBS) -o $@ But you are linking mylib.a as if it were an object file! I think it needs to be supplied with a -l flag to be treated as a library, does it not ? Try renaming mylib.a to libmylib.a (ld requires the name to be in the format libXXXX.a and then you use -lXXXX), and then try using the ld line in the makefile like > $(LD) --gc-sections $(LDFLAGS) $^ -lmylib -L. $(LIBS) -o $@ - ie we tell it that we want the library mylib, it knows then to look for 'libmylib.a', and the -L. tells it that the lib may be found in the current directory. >******************************************** >compiling appcon.c >h8300-hitachi-hms-ld: warning: no memory region specified for section `. >_init' >h8300-hitachi-hms-ld: warning: no memory region specified for section >`.configu' >h8300-hitachi-hms-ld: warning: no memory region specified for section >`.timerIn' >************************************************* This may reflect a problem with the srec format limiting the length of section name strings, but see if it goes away when you try the new flags. DaveK -- Burn your ID card! http://www.optional-identity.org.uk/ Help support the campaign, copy this into your .sig! ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ********************************************************************** -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/