From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by sourceware.org (Postfix) with ESMTPS id 4C09E3858026 for ; Thu, 7 Oct 2021 16:53:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C09E3858026 Received: by mail-qk1-x735.google.com with SMTP id l7so6684663qkk.0 for ; Thu, 07 Oct 2021 09:53:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7GvSAf5eynIJM5kn/Gq9K66fADd0a1/KDp2BJpSuIzw=; b=hNKJFxMC/25zMdbDWFFii52PB6nUNCll3cYkLyxo25+uoABE2oa1TG7KTu93Et8UM+ xbRPp3Uh2dlKkgotBVLq2VHVOeC/9GCRBwMZVx1EJbuK/pw1qRUfIx4G/LZ1CLSpumJJ CDLlIUdp53OPymX4dwQIILHfFJszVgVyUkB0KzKUGihB6/gWymxui9DqRBmUoFQNIfqa hMcFRyPk54opodUB8juHoJvfRz1mXzxbN5lxz2IfulQAt0oQjj4yr5z6WIVLeF1XbjLB UOJyWir1kBn3Yde/mnbMc9H1KZbYOLaGHTUKpIEsMenOs3oeVm8J4ut6Bxk+PFrRVsJ0 XiXQ== X-Gm-Message-State: AOAM531nIU45/zR9BuXAMhqufAqJ1LXRw4DsS9ObuoMGmW3nisaXFZZH i2qpKlutU35wtuz5BOu/C1tw0Q== X-Google-Smtp-Source: ABdhPJxhJaV5fDeKBKfiPL2nPF0mnE4Or1u/RJHath1ZD52113vjmwi+kbcnEeXJzjENKSuEvxRdWQ== X-Received: by 2002:a37:9d16:: with SMTP id g22mr4370523qke.158.1633625638893; Thu, 07 Oct 2021 09:53:58 -0700 (PDT) Received: from ?IPv6:2804:431:c7cb:807a:2864:3aef:e68:8698? ([2804:431:c7cb:807a:2864:3aef:e68:8698]) by smtp.gmail.com with ESMTPSA id 14sm68604qtx.33.2021.10.07.09.53.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Oct 2021 09:53:58 -0700 (PDT) Subject: Re: [PATCH] dl: Use "adr" assembler command to get proper load address To: "H.J. Lu" , Szabolcs Nagy Cc: Florian Weimer , libc-alpha , Andreas Schwab , Joseph Myers References: <20210907174417.sctsswphsyae4mpc@google.com> <20211005094554.2f28d6bd@ktm> <20211006075721.qnv6qabroytcsido@google.com> <20211006110321.5f1a9610@ktm> <20211006134344.63395242@ktm> <20211006125517.GE2700@arm.com> <20211007111926.30db4c4f@ktm> <20211007120038.1445bbd3@ktm> <44bac775-3127-7bc7-c4ea-fa282ed277d3@linaro.org> <20211007155730.GG2700@arm.com> From: Adhemerval Zanella Message-ID: Date: Thu, 7 Oct 2021 13:53:56 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Thu, 07 Oct 2021 16:54:00 -0000 On 07/10/2021 13:22, H.J. Lu wrote: > On Thu, Oct 7, 2021 at 8:57 AM Szabolcs Nagy wrote: >> >> The 10/07/2021 07:29, H.J. Lu via Libc-alpha wrote: >>> On Thu, Oct 7, 2021 at 7:18 AM Adhemerval Zanella via Libc-alpha >>> wrote: >>>> On 07/10/2021 07:00, Lukasz Majewski wrote: >>>>> On Thu, 7 Oct 2021 11:19:26 +0200 >>>>> Lukasz Majewski wrote: >>>>> And indeed it is the case. Yocto/OE by default perform prelinking (use >>>>> prelink program) to speedup start time of dynamic program. >>>>> >>>>> The prelink [1] itself assigns some virtual addresses to all required >>>>> shared objects (in our case for /sbin/init), so no clashes are >>>>> encountered. >>>>> >>>>> And using prelink is a _default_ behaviour in Yocto/OE poky distro. >>>> >>>> Does it work without prelink? Also, does it fail with prelink in real >>>> hardware? >>>> >>>> It indeed might be a prelink issue in fact. >>> >>> This will fail everywhere if prelink is used. >> >> i thought the point of prelinking is that the vaddr in >> the elf image is the runtime address so you don't have >> to process relative relocs or adjust pointers in the >> dynamic array with += l_addr at all (and then l_addr >> does not have to be correct, ld.so would still work). >> >> but here ld.so is loaded to some random offset on top >> of the static prelink offset. is this expected? >> does it make sense to prelink ld.so this way? > > ld.so is loaded by the kernel. It makes no sense to > prelink ld.so. > The question is whether we consider this a regression or if we don't support it and instruct consumers to not do it.