This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
ping: [patch] Fix l_addr comment
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 1 Feb 2013 03:47:00 +0100
- Subject: ping: [patch] Fix l_addr comment
Hi,
there are still misunderstandings by people what L_ADDR means.
Original post had Jakub's comment but I do not see which effect it should have
on this patch:
http://sourceware.org/ml/libc-alpha/2011-09/msg00151.html
Thanks,
Jan
On Fri, 30 Sep 2011 16:41:39 +0200, Jan Kratochvil wrote:
Hi,
there is confusion what does l_addr mean as on systems without prelink it has
the value which the comment describes. But with prelink it is not the case:
(gdb) p *_r_debug.r_map.l_next.l_next
$5 = {l_addr = 0, l_name = 0x7ffff7ffd740 "/lib64/libreadline.so.6", l_ld = 0x3f1d83bf90, l_next = 0x7ffff7fd3000, l_prev = 0x3f15420818}
^
Thanks,
Jan
2011-09-30 Jan Kratochvil <jan.kratochvil@redhat.com>
* elf/link.h (struct link_map): Extend the l_addr comment.
* include/link.h (struct link_map): Likewise.
--- a/elf/link.h
+++ b/elf/link.h
@@ -87,7 +87,12 @@ struct link_map
/* These first few members are part of the protocol with the debugger.
This is the same format used in SVR4. */
- ElfW(Addr) l_addr; /* Base address shared object is loaded at. */
+ ElfW(Addr) l_addr; /* Base address shared object is loaded at
+ minus where the object is prelinked to.
+ For successfully prelinked objects it is 0,
+ for non-prelinked objects it is its base
+ address. It can be also anything else for
+ prelinked objects loaded elsewhere. */
char *l_name; /* Absolute file name object was found in. */
ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
--- a/include/link.h
+++ b/include/link.h
@@ -88,7 +88,12 @@ struct link_map
/* These first few members are part of the protocol with the debugger.
This is the same format used in SVR4. */
- ElfW(Addr) l_addr; /* Base address shared object is loaded at. */
+ ElfW(Addr) l_addr; /* Base address shared object is loaded at
+ minus where the object is prelinked to.
+ For successfully prelinked objects it is 0,
+ for non-prelinked objects it is its base
+ address. It can be also anything else for
+ prelinked objects loaded elsewhere. */
char *l_name; /* Absolute file name object was found in. */
ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
struct link_map *l_next, *l_prev; /* Chain of loaded objects. */