public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: erikh@msoft.com (Erik Horstkotte)
To: "'eCos Discussion'" <ecos-discuss@sourceware.cygnus.com>
Cc: "John Mills" <Jmills@TGA.com>
Subject: Re: [ECOS] Library Circularity Question
Date: Wed, 07 Jul 1999 15:49:00 -0000	[thread overview]
Message-ID: <04b301bec8ca$a9fc8440$913150d1@msoft.com> (raw)
In-Reply-To: <FD7521AABD30D2118284006008AE0B6E03BFC0@ns1.tga.com>

> Originally I provided a dummy 'delete' operator to satisfy linkage of a
> pro-forma C++ destructor. The problem came up when I tried to find a linkage
> sequence which would actually implement some dynamic storage allocation and
> deallocation. Linking with "-lgcc"
> [from "<tooldir>/lib/gcc-lib/sh-hms/2.9-ecosSWtools-990310/libgcc.a"] left
> unresolved symbols; adding a trailing link command "-lc" didn't resolve all;
> but adding a _second_ "-lgcc" after "-lc" resolved all symbols:
>     $(XLD) $(LDFLAGS) -o $@ ${OBJS} -lgcc -lc -lgcc

It's a characteristic of the GNU linker, and the older Unix "ld" linkers. By default,
they only look externals up in each library once, from left to right. If a library on the
right externs something that's public in a library to its left, it won't find it.

Either specify the libraries more than once, as you did, or use the -( and -)
linker options to force the linker to check the libraries repeatedly, like the linkers
you're probably familiar with.

-- Erik


  reply	other threads:[~1999-07-07 15:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-07 15:34 John Mills
1999-07-07 15:49 ` Erik Horstkotte [this message]
1999-07-07 15:49 Timothy Konkle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='04b301bec8ca$a9fc8440$913150d1@msoft.com' \
    --to=erikh@msoft.com \
    --cc=Jmills@TGA.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).