This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: DL_DEBUG_UNUSED buggy, especially with vdso
From: David Miller <davem@davemloft.net>
Date: Tue, 03 Apr 2012 23:59:32 -0400 (EDT)
> So we have two issues to resolve:
>
> 1) Skipping the VDSO in the link map while walking the DT_NEEDED
> entries
Ok, this patch takes care of the VDSO issue.
Any objections?
2012-04-04 David S. Miller <davem@drr.davemloft.net>
* elf/rtlc.c (dl_main): Skip VDSO when checking for unused
DT_NEEDED entries.
diff --git a/elf/rtld.c b/elf/rtld.c
index 1cc9cf3..d90433f 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1967,7 +1967,12 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
if (dyn->d_tag == DT_NEEDED)
{
l = l->l_next;
-
+#if defined NEED_DL_SYSINFO || defined NEED_DL_SYSINFO_DSO
+ /* Skip the VDSO since it's not part of the list
+ of objects we brought in via DT_NEEDED entries. */
+ if (l == GLRO(dl_sysinfo_map))
+ l = l->l_next;
+#endif
if (!l->l_used)
{
if (first)