1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

Fix DL_DEBUG_UNUSED to elide the VDSO and handle PLT references properly.

* elf/rtld.c (dl_main): If DL_DEBUG_UNUSED is enabled, turn off
	lazy binding.
	* elf/dl-lookup (_dl_lookup_symbol_x): If DL_DEBUG_UNUSED, ignore
	undefined symbol errors.

	* elf/rtlc.c (dl_main): Skip VDSO when checking for unused
	DT_NEEDED entries.
This commit is contained in:
David S. Miller
2012-04-05 05:20:37 -04:00
parent e80d6f94e1
commit ff9f1c5f32
3 changed files with 26 additions and 2 deletions

View File

@@ -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)
@@ -2500,6 +2505,14 @@ warning: debug option `%s' unknown; try LD_DEBUG=help\n", copy);
++dl_debug;
}
if (GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)
{
/* In order to get an accurate picture of whether a particular
DT_NEEDED entry is actually used we have to process both
the PLT and non-PLT relocation entries. */
GLRO(dl_lazy) = 0;
}
if (GLRO(dl_debug_mask) & DL_DEBUG_HELP)
{
size_t cnt;