From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 13F93385B1B6 for ; Mon, 28 Nov 2022 14:24:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 13F93385B1B6 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 4CD7D21B93; Mon, 28 Nov 2022 14:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1669645470; h=from:from:reply-to: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=u/ZgIvmGzw/GGG650IXKO2O6GlgjzpKBf6FUx/DEX8U=; b=UIa2C2YoN/1RwVxrJIdn9AqZly6f/1MBGCtoVUyOW7cRUSWajLWOFe2ZRi9URaDJYaTkUp fCsTTV/hYVzqQHaQsMtYVt2dFz333SDeyZOiiV/Dqp/P6RWL0N0tufMitehH3dqYOF8zqt 0jdTth4ZJ7Y/sgYhGbVT7KSs23Y5TeA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1669645470; h=from:from:reply-to: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=u/ZgIvmGzw/GGG650IXKO2O6GlgjzpKBf6FUx/DEX8U=; b=YckawI9SliMWaM84gCXMJSqnb/bGPbDpDB2C7WQ/jat31mwL+nf6dTvnw1SqzSMnROgtQ6 XgZCPEqRCGyhu0CQ== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 465622C141; Mon, 28 Nov 2022 14:24:30 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 3F0B9647B; Mon, 28 Nov 2022 14:24:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id 3D4DC6240; Mon, 28 Nov 2022 14:24:30 +0000 (UTC) Date: Mon, 28 Nov 2022 14:24:30 +0000 (UTC) From: Michael Matz To: Alan Modra cc: binutils@sourceware.org Subject: Re: [PATCH 4/8] section-select: Completely rebuild matches In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,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: Hello, On Mon, 28 Nov 2022, Alan Modra wrote: > On Fri, Nov 25, 2022 at 04:55:12PM +0000, Michael Matz via Binutils wrote: > > this resets all section matches before updating for newly created > > sections (i.e. completely rebuilds the matches). This fixes powerpc > > "TOC opt" tests that shows a difference in section order: originally > > .got of "linker stubs" comes before .toc (both placed into the same > > .got output section due to ".got {*(.got .toc)}". But .got of linker > > stubs is created later, and in the second run of resolve_wilds is > > appended to the list, hence is then coming after .toc (which was added > > already in the earlier resolve_wilds run). So order swapped -> > > test fails. > > That's a problem. The got header is created in the .got of "linker > stubs", and code setting the value of .TOC. assumes that the header > will be located first in the .got output section. This ties in with > where ld.so expects to find the header too. I see. But then why is the testcase (and linker script?) not using .got { *(.got) *(.toc) } ? The way it's written right now means "for each file, first its .got then its .toc, intermixed", i.e. file1.got, file1.toc, file2.got, file2.toc ... And it seems a bit fuzzy to speak about "files" for the artificial generated pseudo files like "linker stubs". (Just to be clear: rebuilding all matches also solves this problem) Ciao, Michael.