This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a function's loaded address in memory


Hi Sean,

If I can know write() is (dynamically) loaded to 0x192780--0x19279c, then I know that
0x19279a/sys_write() is from it because 0x19279a belongs to [0x192780, 0x19279c].
My question is: is there an easy mechanism that I can get the information of which function is loaded where in a run?

You could have the program itself print out the addresses of important functions when it is running. eg:


printf ("The address of write() is %p\n", write);

If you use the prelink command to prepare your shared libraries for loading then you could use the -v switch to get the base address of the libraries. From this and the output of running nm on the nearest library you should be able to work out which function was at a particular address.

Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]