From patchwork Tue Feb 26 11:47:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael Kerrisk \\(man-pages\\)" X-Patchwork-Id: 31594 Received: (qmail 46190 invoked by alias); 26 Feb 2019 11:48:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 45590 invoked by uid 89); 26 Feb 2019 11:48:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Verify, UD:8 X-HELO: mail-ot1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=IuMBFbhCRi1u2vDYScAMaFmnRpSXkLl7GjCCD9qfoIs=; b=mBZ2k3Mjf0FEBhqMmUAl3iyoY2B50QpT7i0jwKKN0dzjNlZlnmGLb/eUsXm3i7iDX0 cR2Fio1T294Xipgry8A3fyQcGDZd1T+MN5UbNfOUu6okiGEFmbFNA+I9W5rlefFWEqG+ 9sGi+mAA+cMc4vuxg7t8Hma1jTxWoYUxaEXjb5M2udi3xYWWDmk0zSHOOjuWg7RhRVv2 3wLi180aeOdX7sprCXkRnB6Dzq3GvxOQfTwcSZ1SYSwiE0sanMEKMUp1HAjkJ3nu5rBF moLibaY3Djc4MkWfnCPq8nGCLldyAVg4uEU/zU7fVQ+AQVbKnxkZeUx/Egdq2CPSJsbe gR3A== MIME-Version: 1.0 References: <322fb70a-9c0e-100b-4366-dfa7e5134aa5@davidnewall.com> <265bec63-9875-7268-2199-c7e133b2298e@davidnewall.com> <874ldb7gxp.fsf@oldenburg.str.redhat.com> <5f79f366-d687-583f-940c-36c169bd34a9@davidnewall.com> <87sh0eqssf.fsf@oldenburg.str.redhat.com> <8816b7fc-d798-42ee-de51-d1de56e6887c@davidnewall.com> <87zhuljiev.fsf@oldenburg.str.redhat.com> <43265e8e-956a-f895-6c04-8cd6898a8c97@davidnewall.com> <877ehphv2a.fsf@oldenburg.str.redhat.com> <2e1f89d3-9718-50ca-328c-b4b82b1974d4@davidnewall.com> <8736sdhtim.fsf@oldenburg.str.redhat.com> <87va57dekq.fsf@oldenburg.str.redhat.com> <87d0o7ra5o.fsf@oldenburg2.str.redhat.com> In-Reply-To: <87d0o7ra5o.fsf@oldenburg2.str.redhat.com> From: Michael Kerrisk Date: Tue, 26 Feb 2019 12:47:49 +0100 Message-ID: Subject: Re: [PATCH] ld.so: command argument "--preload" To: Florian Weimer Cc: David Newall , "Carlos O'Donell" , libc-alpha , Michael Kerrisk-manpages I've added documentation for the --preload option to the ld.so(8) manual page. Please let me know if I missed anything in the text below. --preload list (since glibc 2.30) Preload the objects specified in list. The objects in list are delimited by colons or spaces. The objects are pre‐ loaded as explained in the description of the LD_PRELOAD environment variable below. By contrast with LD_PRELOAD, the --preload option provides a way to perform preloading for a single executable without affecting preloading performed in any child process that executes a new program. ... LD_PRELOAD ... There are various methods of specifying libraries to be preloaded, and these are handled in the following order: (1) The LD_PRELOAD environment variable. (2) The --preload command-line option when invoking the dynamic linker directly. (3) The /etc/ld.so.preload file (described below). Thanks, Michael diff --git a/man8/ld.so.8 b/man8/ld.so.8 index 6271f23ed..cdc4f233d 100644 --- a/man8/ld.so.8 +++ b/man8/ld.so.8 @@ -192,6 +192,24 @@ are delimited by colons or spaces. .B \-\-list List all dependencies and how they are resolved. .TP +.BR \-\-preload " \fIlist\fP (since glibc 2.30)" +Preload the objects specified in +.IR list . +The objects in +.I list +are delimited by colons or spaces. +The objects are preloaded as explained in the description of the +.BR LD_PRELOAD +environment variable below. +.IP +By contrast with +.BR LD_PRELOAD , +the +.BR \-\-preload +option provides a way to perform preloading for a single executable +without affecting preloading performed in any child process that executes +a new program. +.TP .B \-\-verify Verify that program is dynamically linked and this dynamic linker can handle it. @@ -347,6 +365,23 @@ as described above in .\" .\" which will preload the libmod.so in 'lib' or 'lib64', using it .\" in preference to the version in '.'. +.IP +There are various methods of specifying libraries to be preloaded, +and these are handled in the following order: +.RS +.IP (1) 4 +The +.BR LD_PRELOAD +environment variable. +.IP (2) +The +.B \-\-preload +command-line option when invoking the dynamic linker directly. +.IP (3) +The +.I /etc/ld.so.preload +file (described below). +.RE .TP .BR LD_TRACE_LOADED_OBJECTS If set (to any value), causes the program to list its dynamic