[PATCH] dl-dtprocnum.h

Mark Kettenis kettenis@wins.uva.nl
Fri Jun 9 16:36:00 GMT 2000


   From: Ulrich Drepper <drepper@redhat.com>
   Date: 09 Jun 2000 16:11:13 -0700

   Mark Kettenis <kettenis@wins.uva.nl> writes:

   > Yep, GDB uses it, probably ever since it supports debugging ELF shared
   > libraries.  The header seems to be available on all SVR4 derived
   > systems and on ELF based *BSD systems too.  The comments in our
   > <link.h> explicitly say that it is intended to be used by the
   > debugger.

   The debugger is using r_debug.  But link_map?

Sure, it walks the map to find out which dynamic libraries are loaded,
their names, the address they're loaded at, etc.  That's what the
r_map member of `struct r_debug' is there for.

All this stuff is in gdb/solib.c (which also implements support for
old SunOS 4 shared libraries, so look at the bits that are
conditionalized on SVR4_SHARED_LIBS; this should be cleaned up of
course).  The same code is used for SVR4, Solaris, Linux, the Hurd,
FreeBSD/ELF and NetBSD/ELF.

Mark


More information about the Libc-hacker mailing list