* 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.
+2012-04-05 David S. Miller <davem@davemloft.net>
+
+ * 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.
+
2012-04-05 Michael Matz <matz@suse.de>
[BZ #13592]
if (__builtin_expect (current_value.s == NULL, 0))
{
if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK)
- && skip_map == NULL)
+ && skip_map == NULL
+ && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED))
{
/* We could find no value for a strong reference. */
const char *reference_name = undef_map ? undef_map->l_name : "";
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)
++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;