All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: text base address of a library
Date: Tue, 16 Sep 2003 23:18:12 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106375429823565@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-106375355522819@msgid-missing>

>>>>> On Tue, 16 Sep 2003 16:05:53 -0700, Umut Aymakoglu <umuta@us.ibm.com> said:

  Umut> Hi - Is there a way(function) to find the text base address of
  Umut> a loaded library?

  Umut> a.c: main() { b(); }

  Umut> b.c: b() {}

  Umut> %gcc -c b.c %gcc -shared -o b.sl b.o %gcc -o a a.c ./b.sl

  Umut> %ldd a ./c.sl => ./c.sl (0x2000000000044000) <---------- how
  Umut> can i find this address within a program?

dl_iterate_phdr() is probably what you want.  For better or worse, it
is said to be a trivial interface which requires no documentation [1].
libunwind has some sample code which may help you (see
src/ia64/tables-ia64.c).

	--david

[1] http://sources.redhat.com/ml/libc-alpha/2003-02/msg00031.html

      reply	other threads:[~2003-09-16 23:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-16 23:05 text base address of a library Umut Aymakoglu
2003-09-16 23:18 ` David Mosberger [this message]

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=marc-linux-ia64-106375429823565@msgid-missing \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.