From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49615 invoked by alias); 25 Oct 2019 12:55:33 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 49601 invoked by uid 89); 25 Oct 2019 12:55:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=H*i:sk:87tv7x8, H*f:sk:87tv7x8, H*MI:sk:87tv7x8 X-HELO: mx1.redhat.com Subject: Re: [PATCH] elf: Always set l in _dl_init_paths (Bug 23462). To: Florian Weimer Cc: libc-alpha References: <87d0ex6mo6.fsf@oldenburg2.str.redhat.com> <8b35f8b3-1d61-dce0-f59a-42c104449a44@redhat.com> <87bluh53z3.fsf@oldenburg2.str.redhat.com> <79397430-ce3f-446e-eadb-18531ad5ae79@redhat.com> <87tv7x8bme.fsf@oldenburg2.str.redhat.com> From: Carlos O'Donell Message-ID: <6ff07e30-477f-81dd-1948-0900fa9d70c9@redhat.com> Date: Fri, 25 Oct 2019 12:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <87tv7x8bme.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-10/txt/msg00756.txt.bz2 On 10/25/19 4:36 AM, Florian Weimer wrote: > * Carlos O'Donell: > >> This does not turn out to be true. And it makes sense when I think >> about it more thoroughly. >> >> The static executable, lacking a .dynamic section, does not fill in >> any of the link maps's l_info data, in fact it's all just a list of >> NULLs because there was no data to load. > > Statically linked executables can have dynamic segments. However, there > seems to be a bug in BFD ld because it ignores -rpath for them. OK, so we assume you can assemble a minimum .dynamic in a static executable with a DT_RUNPATH or DT_RPATH that will impact a dlopen made from a static executable? Did you file a binutils bug for this? >> You would have to assemble a static binary with a .dynamic section >> and the static linker doesn't want to do that. > > You can use -static-pie on some targets, then there is a dynamic > segment, and BFD ld adds DT_RPATH to it. Oh! That's a great idea, let me add a test case conditioned on that then, since we have all those pieces in place. -- Cheers, Carlos.