public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Ravi Ramaseshan <ramaseshan.ravi@gmail.com>
To: "Øyvind Harboe" <oyvind.harboe@zylin.com>
Cc: binutils@sources.redhat.com
Subject: Re: Referenced symbol not present in final image?
Date: Fri, 08 Apr 2005 12:23:00 -0000	[thread overview]
Message-ID: <22080b0a05040805236f1d6206@mail.gmail.com> (raw)
In-Reply-To: <1112956254.23080.30.camel@localhost.localdomain>

On Apr 8, 2005 4:00 PM, Øyvind Harboe <oyvind.harboe@zylin.com> wrote:
> Using binutils 2.15:
> 
> Under what circumstances would the linker allow a symbol to be
> referenced but not defined?

If you define a symbol as weak and do not provide a definition for the
same (as in the example below) then the linker would allow the symbol
to be undefined but still referenced in the binary.

<snip>

#include<stdio.h>

void foo() __attribute__ ((weak));

int main()
{
 int c;

 if(!c)
   foo();

 return 0;
}

</snip>

Regards,
Ravi Ramaseshan.

PS: Please correct me if I am wrong. Sorry for the incomplete reply I
sent earlier.

-- 
" All man's miseries derive from not being able to sit in a room alone. "
- Blaise Pascal

  reply	other threads:[~2005-04-08 12:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-08 10:30 Øyvind Harboe
2005-04-08 12:23 ` Ravi Ramaseshan [this message]
2005-04-08 11:14 Øyvind Harboe
2005-04-08 12:17 ` Dave Korn
2005-04-08 12:31   ` Øyvind Harboe

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=22080b0a05040805236f1d6206@mail.gmail.com \
    --to=ramaseshan.ravi@gmail.com \
    --cc=binutils@sources.redhat.com \
    --cc=oyvind.harboe@zylin.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).