Re: Extracting symbol info out of processes at runtime
From: P. de Boer (pieter_at_thelostparadise.com)
Date: 04/29/04
- Previous message: Marc Olzheim: "Re: Loosing STDOUT after file rotation"
- In reply to: Dag-Erling Smørgrav: "Re: Extracting symbol info out of processes at runtime"
- Next in thread: Eric Jacobs: "Re: Extracting symbol info out of processes at runtime"
- Reply: Eric Jacobs: "Re: Extracting symbol info out of processes at runtime"
- Reply: Eric Jacobs: "Re: Extracting symbol info out of processes at runtime"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Dag-Erling Smørgrav <des@des.no> Date: Thu, 29 Apr 2004 14:51:47 +0200
On Thu, 2004-04-29 at 14:30, Dag-Erling Smørgrav wrote:
> "P. de Boer" <pieter@thelostparadise.com> writes:
> > For a little private project I'm working at, I need to find the address
> > of a function which is inside a shared library of a running process, OR
> > the base address the library is running at
>
> man dlinfo
Well, yes, dlinfo() would be very useful, if it was not for my wish to
read the link_map from another proces, using ptrace(). I've looked at
rtld-elf.c, to see what dlinfo() does: it finds the object by the given
address and then 'returns' the link_map for that object. However, I
can't find out where this info would be in the memory image of a running
process.
Apparantly the objects the loader keeps info on, are in a linked list,
'obj_list', which is a global var of rtld-elf.c. Would this mean the
info I'm trying to find is on the stack of the dynamic linker and
therefor can't be found as long as I don't know where the linker is
loaded into memory? Sounds like a chicken-and-egg problem in that case.
If so, that would make things suckier than they already are, since I'm
actually working on a Linux binary/libs, running on FreeBSD at the
moment.. I hope(d) there was/is a generic method for all ELF binaries
available, but if not, I'd better bug the Linux people a bit.
-- Pieter de Boer _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Marc Olzheim: "Re: Loosing STDOUT after file rotation"
- In reply to: Dag-Erling Smørgrav: "Re: Extracting symbol info out of processes at runtime"
- Next in thread: Eric Jacobs: "Re: Extracting symbol info out of processes at runtime"
- Reply: Eric Jacobs: "Re: Extracting symbol info out of processes at runtime"
- Reply: Eric Jacobs: "Re: Extracting symbol info out of processes at runtime"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]