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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id BBB9F385742D for ; Fri, 17 Sep 2021 03:46:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BBB9F385742D 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-551-OGhyBeOkOru7Dm6yE6aKZg-1; Thu, 16 Sep 2021 23:46:27 -0400 X-MC-Unique: OGhyBeOkOru7Dm6yE6aKZg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5FF82801B3D; Fri, 17 Sep 2021 03:46:26 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A53AE19C79; Fri, 17 Sep 2021 03:46:22 +0000 (UTC) From: Florian Weimer To: Siddhesh Poyarekar Cc: "H.J. Lu" , Carlos O'Donell , GNU C Library Subject: Re: [PATCH] ld.so: Handle read-only dynamic section gracefully [BZ #28340] References: <20210914190919.1728320-1-siddhesh@sourceware.org> <9d0f8dcc-35d4-d87a-b3b0-c006fdfe482f@sourceware.org> <877dfhp1lc.fsf@oldenburg.str.redhat.com> <0002ae3d-8957-2e3f-4fb3-298de3304ad2@redhat.com> <874kakjt2p.fsf@oldenburg.str.redhat.com> <08ca98e1-b141-b31f-2743-bd348cdd359d@sourceware.org> Date: Fri, 17 Sep 2021 05:46:20 +0200 In-Reply-To: <08ca98e1-b141-b31f-2743-bd348cdd359d@sourceware.org> (Siddhesh Poyarekar's message of "Fri, 17 Sep 2021 08:28:15 +0530") Message-ID: <87lf3vj243.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.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable 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: Fri, 17 Sep 2021 03:46:31 -0000 * Siddhesh Poyarekar: > On 9/16/21 11:33 PM, Florian Weimer wrote: >> * H. J. Lu: >> >>> No. Relocation of vDSO dynamic section is done by elf_get_dynamic_info. >>> Here is a patch to remove the hack for vDSO. >> I have concerns that this does not actually work on MIPS. What >> happens >> if the object has a single RWX LOAD segment? What kind of flags will >> the link editor set on the DYNAMIC segment in this case? RWX or R, RX? >> I suspect it will be RWX, which means that we actually need the special >> case. > > The DYNAMIC segment flags will be based on .dynamic, which is > read-only for MIPS. Right, as far as I can tell BFD ld does not copy the W bit to the DYNAMIC segment even if it is located inside an RW LOAD segment. So unless there are old binaries floating around which were linked differently, the change should be correct for MIPS, too (and likewise for RISC-V, although I did not check that). Thanks, Florian