delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/11/19/06:58:28

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <718D38CAB6E0D011B2C90060970C28A57E1AB8@exchangeserver.pixelpower.com>
From: David Korn <dkorn AT pixelpower DOT com>
To: "'Mohammad Saleem'" <mosa AT enea DOT se>
Cc: crossgcc AT sources DOT redhat DOT com, cygwin AT cygwin DOT com
Subject: RE: linking application with a library
Date: Mon, 19 Nov 2001 12:00:34 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)

-----Original Message-----
>From: Mohammad Saleem [mailto:mosa AT enea DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019