From: Bahadir Balban <bahadir.balban@gmail.com>
To: binutils@sources.redhat.com
Subject: what are weak external symbols?
Date: Mon, 28 Mar 2005 02:08:00 -0000 [thread overview]
Message-ID: <7ac1e90c0503261346244d052f@mail.gmail.com> (raw)
Hi,
I'm reading the book "Linkers and Loaders" and weak external symbols
are not so clearly explained (for me at least).
In summary it says that weak external symbols is a concept to avoid
linking with unused parts of a library. The printf example is given:
floating-point routines (namely fcvt) are referred as weak references
by printf, such that when printf is used in a routine that didn't use
fcvt, reference to fcvt resolves to zero and no error is produced from
this.
Now the questions:
1) Is my summary above correct?
2) Is this a case such that, these fcvt routines are explicitly
defined in printf as weak references? If so, how do you define it as
such in C source? Or perhaps you use a linker flag when you create the
library?
I thought this question best fits the binutils list, sorry if I'm off-topic.
Many thanks,
Bahadir
next reply other threads:[~2005-03-26 21:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-28 2:08 Bahadir Balban [this message]
2005-03-28 14:19 ` Ian Lance Taylor
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=7ac1e90c0503261346244d052f@mail.gmail.com \
--to=bahadir.balban@gmail.com \
--cc=binutils@sources.redhat.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).