From: R <ryan.deemer@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: correct fn defn
Date: Mon, 23 Mar 2009 15:48:00 -0000 [thread overview]
Message-ID: <455a2bc10903230848h7661d904l44eec4cc25fd692c@mail.gmail.com> (raw)
In-Reply-To: <455a2bc10903230834m74d6775btebce5f1a796c7660@mail.gmail.com>
Hi folks,
I wanted to know what happens in gcc in the following scenario.
Say, there is a function by the name jellyfish() defined in libc6.so
Now I compile a binary(say bigben) which also contains jellyfish() defined.
This binary(bigben) of mine has the capability to load a .so at run time..
Now I create a bridge.so which uses jellyfish(), but during compile
time, I link it to another static library(say libpapa.a) which defines
jellyfish(), and if I do an nm on the module, I can see that
jellyfish() is defined in it.
Now I presume that at runtime when bride.so calls jellyfish after
being loaded to bigben, it should actually use the definition which is
present in libpapa.a.
But I see that tracing the code using a debugger shows that it is
actually using the definition from libc6.so.
How can I prevent this from happening and actually ensure that
jellyfish definition is picked up from libpapa.a and neither from
bigben or from libc6.so.
Thanks
Ryan.
next parent reply other threads:[~2009-03-23 15:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <455a2bc10903230834m74d6775btebce5f1a796c7660@mail.gmail.com>
2009-03-23 15:48 ` R [this message]
2009-03-23 15:56 ` John (Eljay) Love-Jensen
2009-03-23 20:28 ` R
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=455a2bc10903230848h7661d904l44eec4cc25fd692c@mail.gmail.com \
--to=ryan.deemer@gmail.com \
--cc=gcc-help@gcc.gnu.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).