elf: Do not print the cache entry if --inhibit-cache is used

So --help informs the correct shared library search path.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
Adhemerval Zanella 2023-10-17 11:50:35 -03:00
parent dd32e1db38
commit c06e10c813

View File

@ -99,7 +99,8 @@ print_search_path_for_help (struct dl_main_state *state)
if (map != NULL)
print_search_path_for_help_1 (map->l_runpath_dirs.dirs);
_dl_printf (" (libraries located via %s)\n", LD_SO_CACHE);
if (!GLRO(dl_inhibit_cache))
_dl_printf (" (libraries located via %s)\n", LD_SO_CACHE);
print_search_path_for_help_1 (__rtld_search_dirs.dirs);
}