From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 952213858D34 for ; Thu, 23 Sep 2021 16:02:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 952213858D34 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-23-zSJNMKhePIy51Q_KpsZDqw-1; Thu, 23 Sep 2021 12:02:19 -0400 X-MC-Unique: zSJNMKhePIy51Q_KpsZDqw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F2D8100CC85; Thu, 23 Sep 2021 16:02:18 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.176]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB6B56A904; Thu, 23 Sep 2021 16:02:17 +0000 (UTC) From: Florian Weimer To: "H.J. Lu" Cc: GNU C Library , Siddhesh Poyarekar Subject: Re: [PATCH v4] ld.so: Replace DL_RO_DYN_SECTION with dl_relocate_ld References: <20210919162805.3277956-1-hjl.tools@gmail.com> <87pmszsi9z.fsf@oldenburg.str.redhat.com> Date: Thu, 23 Sep 2021 18:02:16 +0200 In-Reply-To: (H. J. Lu's message of "Thu, 23 Sep 2021 08:47:36 -0700") Message-ID: <874kabp9fb.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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:02:24 -0000 * 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. Thanks, Florian