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 ESMTPS id D8A35385840D for ; Fri, 4 Nov 2022 16:52:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D8A35385840D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667580778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lXAM/J4WX2DYy1FT9fkJdWRvfynEWQCh5s3gAML1OuI=; b=AnG7lob0l81zOft0IHBLBccqD/eazkVo9yZSwg2gPV3jt33sBVHYc2R5SW0HrrxGdwGETp l7ggWEAQIxSIo7AYxVmPkb6NGmYYQM30nJ7tgT1fYKOtGC1KzdrcQRUz6i1BulLSIFnE5a vqot7ZiufqArtH80UxobHO7sNKz7c6U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-159-ltUKNECRPDiTX4Wbh62SaA-1; Fri, 04 Nov 2022 12:52:55 -0400 X-MC-Unique: ltUKNECRPDiTX4Wbh62SaA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 06594965413; Fri, 4 Nov 2022 16:52:55 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1A9C2024CBF; Fri, 4 Nov 2022 16:52:53 +0000 (UTC) From: Florian Weimer To: "H.J. Lu" Cc: Szabolcs Nagy , libc-alpha@sourceware.org, Joseph Myers , Fangrui Song Subject: Re: x86_64 / i686 no-PIE failures References: <87a6572ny0.fsf@oldenburg.str.redhat.com> Date: Fri, 04 Nov 2022 17:52:51 +0100 In-Reply-To: (H. J. Lu's message of "Fri, 4 Nov 2022 09:48:37 -0700") Message-ID: <87iljuzmos.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 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * H. J. Lu: > On Fri, Nov 4, 2022 at 2:29 AM Szabolcs Nagy wrote: >> >> The 11/04/2022 08:12, Florian Weimer via Libc-alpha wrote: >> > * Joseph Myers: >> > >> > > Now that the uchar.h failures with mainline GCC are fixed, other failures >> > > show up for x86_64 / i686 no-PIE with mainline GCC and binutils (I don't >> > > know how long these have been there): >> > > >> > > /scratch/jmyers/glibc-bot/install/compilers/x86_64-linux-gnu/lib/gcc/x86_64-glibc-linux-gnu/13.0.0/../../../../x86_64-glibc-linux-gnu/bin/ld: /scratch/jmyers/glibc-bot/build/glibcs/x86_64-linux-gnu-no-pie/glibc/elf/ifuncmain1.o: non-canonical reference to canonical protected function `foo_protected' in /scratch/jmyers/glibc-bot/build/glibcs/x86_64-linux-gnu-no-pie/glibc/elf/ifuncmod1.so >> > > /scratch/jmyers/glibc-bot/install/compilers/x86_64-linux-gnu/lib/gcc/x86_64-glibc-linux-gnu/13.0.0/../../../../x86_64-glibc-linux-gnu/bin/ld: failed to set dynamic section sizes: bad value >> > > collect2: error: ld returned 1 exit status >> > > ../Rules:238: recipe for target '/scratch/jmyers/glibc-bot/build/glibcs/x86_64-linux-gnu-no-pie/glibc/elf/ifuncmain1' failed >> > > make[3]: *** [/scratch/jmyers/glibc-bot/build/glibcs/x86_64-linux-gnu-no-pie/glibc/elf/ifuncmain1] Error 1 >> > > make[3]: Leaving directory '/scratch/jmyers/glibc-bot/src/glibc/elf' >> > >> > H.J., >> > >> > this test no longer seems valid with current binutils (or current >> > binutils is broken). >> > >> > ifuncmain1.o has X86_64_32S and X86_64_PLT32 relocations for >> > foo_protected, so the main program must contain a PLT stub for >> > foo_protected. Apparently, ld no longer produces such binaries. >> > >> > What should we do about this? >> >> aarch64 has the same issue since >> >> binutils commit 90b7a5df152a64d2bea20beb438e8b81049a5c30 >> aarch64: Disallow copy relocations on protected data >> >> which should be in the binutils 2.39 release >> >> ld.lld rejects such usage too, i think the plan was to not >> support extern protected symbol refs with canonical address >> moved to the main exe. >> >> so the tests should be changed, but i'm not sure what's >> the best approach (completely dropping protected or just >> ensure the address is not taken in no-pie case). > > Given the linker change, we should drop these tests for non-PIE. If we don't take the address of foo_protected, we'd only have an X86_64_PLT32 relocation. Would that be valid from a linker perspective? Thanks, Florian