This is the mail archive of the 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]

rellocation address in .so


I can't figure how to know the effective address of
a function from a dynamic object.

I'm trying to extract names, files and lines for
each functions, known by its address (as given by
instrument-functions during execution).

For a program compiled with dynamic objects,
I can find the corresponding address in the sym-table
with the correct name by opening the exec.
But in this case (not a local function), I want to
test this address in each dynamic object linked with
the program. The problem is that I don't know how to
convert the program space address of the function
into the shared object address space to access it.

For example a function '_f4' is at 0x8048684 in
the program, and in the lib:
0x490 _f4
with a vma equal to 0x490 -> address '0x0'

The lib containing this function is supposed to be at
address 0x4001d000 (given by ldd and <link.h>) => (0x4001d000)

I cannot figure how to convert 0x8048684 into 0x0.
Can you help me ?
Perhaps I do this the wrong way ?

Thank you for any help.


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