From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id 2B2773858D34; Thu, 23 Sep 2021 16:16:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2B2773858D34 Received: by mail-pj1-x1033.google.com with SMTP id dw14so4810224pjb.1; Thu, 23 Sep 2021 09:16:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZrqjQzmO60h5SuhWjSfLIBbtwcXJI/VBEm4dBhhlFDg=; b=lbPvGy2zCI8oItr5m/6NzXvC59In/PwA650wvtwLbWjq8vJ2IIJgmAUZ2POsMwGw65 5bKn3tg2tp17/h1bcMxz0i6H8MpCT5AYH2mrOEo/WOXwSZ6PgxCA5ZXbO6dCW5YjaQrf Iw9ZuQQJ4vSu4vRy2souecMg45jhLqWi1f2BvX7U+g/m20ROmvug0BVIhJs8WLPWbvO0 kteHInFovGHGXw3rQFl4XPM2716AUL2d8t/6hKLv8L2546oEqMGiyaVD8nYbCRwURDbe 44Q9rks7sYBJWb/ZnYVy0FLh3/HPQ42ACZXgOIO0xfXUMp3EGTajO1lraA8cawPmbWl1 WKlg== X-Gm-Message-State: AOAM531nnT6kfspqKYYekNLIGjbFp6nX95D6YlBQ7f3nb2cmK2C/mLsY n9jR10acPIdWT3ecj/fyMrKQKciu31q4SD/u2ZagHGMEm/g= X-Google-Smtp-Source: ABdhPJxfr98jUv7ujcJc7XMaSwyfXBJ5O1Q+eo5VKd3etankUWK+ATIE5hvOoEKwpciVhhUVInUBzEZMZb7QWd1+MOE= X-Received: by 2002:a17:90b:3805:: with SMTP id mq5mr18602148pjb.143.1632413771273; Thu, 23 Sep 2021 09:16:11 -0700 (PDT) MIME-Version: 1.0 References: <20210919162805.3277956-1-hjl.tools@gmail.com> <87pmszsi9z.fsf@oldenburg.str.redhat.com> <874kabp9fb.fsf@oldenburg.str.redhat.com> In-Reply-To: <874kabp9fb.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Thu, 23 Sep 2021 09:15:35 -0700 Message-ID: Subject: Re: [PATCH v4] ld.so: Replace DL_RO_DYN_SECTION with dl_relocate_ld To: Florian Weimer Cc: GNU C Library , Siddhesh Poyarekar Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3030.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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, 23 Sep 2021 16:16:13 -0000 On Thu, Sep 23, 2021 at 9:02 AM Florian Weimer wrote: > > * H. J. Lu: > > > We can define DL_RO_DYN_SECTION and do > > > > diff --git a/elf/rtld.c b/elf/rtld.c > > index 8d2bba3d43..83adf1c5f5 100644 > > --- a/elf/rtld.c > > +++ b/elf/rtld.c > > @@ -547,6 +547,7 @@ _dl_start (void *arg) > > > > /* Read our own dynamic section and fill in the info array. */ > > bootstrap_map.l_ld = (void *) bootstrap_map.l_addr + elf_machine_dynamic (); > > + bootstrap_map.l_ld_readonly = DL_RO_DYN_SECTION; > > elf_get_dynamic_info (&bootstrap_map); > > > > #if NO_TLS_OFFSET != 0 > > > > Will this work? > > I think it should. We can use DL_RO_DYN_SECTION to define a single, > generic version of dl_relocate_ld, too. Here is the patch: https://sourceware.org/pipermail/libc-alpha/2021-September/131294.html -- H.J.