Re: text base address of a library

From: David Mosberger <davidm_at_napali.hpl.hp.com>
Date: 2003-09-17 09:18:12
>>>>> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Tue Sep 16 19:18:18 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:17 EST