From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 481263890412 for ; Wed, 9 Jun 2021 05:43:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 481263890412 Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 59B49340B10; Wed, 9 Jun 2021 05:43:31 +0000 (UTC) Date: Wed, 9 Jun 2021 01:43:30 -0400 From: Mike Frysinger To: Fergus Dall Cc: libc-alpha@sourceware.org, clumptini , chromeos-toolchain@google.com Subject: Re: [PATCH v3 1/2] rtld: Add --no-default-paths option Message-ID: Mail-Followup-To: Fergus Dall , libc-alpha@sourceware.org, clumptini , chromeos-toolchain@google.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 05:43:33 -0000 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