public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tom Kacvinsky <tkacvins@gmail.com>
To: Binutils <binutils@sourceware.org>
Subject: resolving weak symbols.
Date: Thu, 28 Mar 2024 18:58:36 -0400	[thread overview]
Message-ID: <CAG_eJLcsR4FAOos9OrwkHC8Eh-0PfUOc=iq+EW=LPXf5W+ejtw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 428 bytes --]

HI,

Support I have a static archive libfoo.a that has a weak sym, call it quux.

And the link line I have is

gcc -o foo -L. -lfoo -Wl,--as-needed -lbar -lbaz

Where libbar.so and libbaz.so also have the weak symbol quux.

Then the executable foo has a dynamic dependency on both libbar.so _and_
libbaz.so.

Is this expected behavior?  Is there a way of forcing exactly one of
libfoo.so and libbaz.so to be used?

Thanks,

Tom

             reply	other threads:[~2024-03-28 22:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 22:58 Tom Kacvinsky [this message]
2024-03-30  1:43 ` Alan Modra
2024-04-12 16:01 ` Nick Clifton

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='CAG_eJLcsR4FAOos9OrwkHC8Eh-0PfUOc=iq+EW=LPXf5W+ejtw@mail.gmail.com' \
    --to=tkacvins@gmail.com \
    --cc=binutils@sourceware.org \
    /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).