[PATCH v3 1/2] rtld: Add --no-default-paths option

Mike Frysinger vapier@gentoo.org
Wed Jun 9 05:43:30 GMT 2021


On 07 Jun 2021 20:28, Fergus Dall via Libc-alpha wrote:
> This option causes the default library search path to be skipped,
> using only the paths in DT_RPATH, LD_LIBRARY_PATH, and
> DT_RUNPATH. This option implies --inhibit-cache, as there is no point
> in searching a cache of system libraries when we are not using the
> system libraries at all.

in docs, should we be overly pedantic for clarity sake ?  for example:
-search the default system paths
+search the default (compiled in) system paths

> --- a/elf/rtld.c
> +++ b/elf/rtld.c
> @@ -1204,6 +1205,15 @@ dl_main (const ElfW(Phdr) *phdr,
>  	    _dl_argc -= 2;
>  	    _dl_argv += 2;
>  	  }
> +        else if (! strcmp (_dl_argv[1], "--no-default-paths"))
> +          {
> +            GLRO(dl_search_default_paths) = 0;
> +            GLRO(dl_inhibit_cache) = 1;

bad indentation

> --- a/sysdeps/generic/ldsodefs.h
> +++ b/sysdeps/generic/ldsodefs.h
> @@ -551,6 +551,9 @@ struct rtld_global_ro
>    /* Do we read from ld.so.cache?  */
>    EXTERN int _dl_inhibit_cache;
>  
> +  /* Do we search the default system paths? */

two spaces before */
-mike


More information about the Libc-alpha mailing list