Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11699184rwl; Tue, 3 Jan 2023 03:30:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXsG01chC5O6pRZX2dGRigWxC94+W1/FRR0t9sXyDXl5lZQcg87oSub+XJ/848j2xkhl29Lt X-Received: by 2002:a05:6402:914:b0:479:dc9c:1144 with SMTP id g20-20020a056402091400b00479dc9c1144mr40077506edz.24.1672745416123; Tue, 03 Jan 2023 03:30:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672745416; cv=none; d=google.com; s=arc-20160816; b=rADjeLyO5DLyw5bxmbKiojEknMrJJ19m4sjr/wMtMaEmo2zy+pNomjKVb5xWJFcWTi lUpotNC/ADRVTeMDH0YG6Ltw0dEPfyjCMcFqylBM9kG0OkvWVd8NSYL8iE+oJDFUKxaC 99zwfBAb6F6iGSxQsx8KeYr47gjg5s64nQamX3005qBOBnCD/zW0CHnQA7Ijq9JBl//w M2saR5h4fW4CeUAn9cC80LA24cxjL2OYoxIDjv8gJnO0q3QAlSQeMgEEN/d6ExDcLtTM UPr3pLdWP83YuMHA90va92PT/QkWrKSoYRtxqoarAumxO41wYeHPjqGsyNP0M0BqwVH4 AC9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WGd+swEGb1rUpPPiC7Yv4V8UjJ03tuigIoR8JLqOlUY=; b=ePxe1c1jdzQ1O66ZCgMi5u9nexGZ5Rty8SiQBMy+GqeIiFvnSWzaeEJuC0FNa0A3J2 mxkAQijooM2YDxo72ga5Ya2zTdmLY98ZerZn8hNdJto9XH4fvvZ4rnQQT7I36N9rP728 k7l0fl5aby7uCA+6JLj3yRo4MXSohzxFla1fTVzLAmRarSE8vBniMDiuq1zMkkg2Rq5E gvuyoVth8NgyneIYnJ/0l67nK03nbsGpJ1xz1lbjQ+slJTmQ6QxsL/hLpJqAFJPnJZ9+ 7EZEpfFlVMS/sCUk/zsGFsjx8HhGfpnSFnrDe4Atot5NV1dPy0Vs7K+KS4fSCKz86Cbm tJkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lqUx2YMh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a0564020e8300b00487529d2a0dsi16194998eda.335.2023.01.03.03.30.01; Tue, 03 Jan 2023 03:30:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lqUx2YMh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236962AbjACK7S (ORCPT + 61 others); Tue, 3 Jan 2023 05:59:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237151AbjACK7F (ORCPT ); Tue, 3 Jan 2023 05:59:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5E06287 for ; Tue, 3 Jan 2023 02:59:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4D349B80E95 for ; Tue, 3 Jan 2023 10:59:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCFEDC43398 for ; Tue, 3 Jan 2023 10:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672743541; bh=CXbMsJ8amTRDKFFvM6G54IqkXE31MPgUrU/r8iQhkdI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lqUx2YMh1XCUkQFXRJ1CW82dcrzC4UQyFRw0dDceRqP2ZO0naI4GfcmhofQngSEuJ 8RYfsVQr6L9r7U/AKlQChOac3aZqOT1oEAPXR3cu9bfff8zNwL2amiw6Zq0qNhdnik VtkZCmaOiWHH7/GUqNu2vGAExdsLMY7oCIGDqUqCPYzE+v69xlb0Gg4lklT/glC9mP wN5mNLlZdQ8Ie56NNbtCnwQFichqn8KZI3fKMJOopTp3CP7WCLpcbzG7EEhbSb+vaI hm4K/VJpP/LioUTjgKCu627Dsi1UHbF8K1ij4qy5Tb5A9fpTB14coKgIbH1/jXksFz 2dhqOOQbWA44A== Received: by mail-lf1-f43.google.com with SMTP id m6so34771829lfj.11 for ; Tue, 03 Jan 2023 02:59:01 -0800 (PST) X-Gm-Message-State: AFqh2krTTUnTQdqLjXuu+0KZyTTdBVC0gdnu6uB0oiwC9FMC6tYNfyIO dFLwrMQwMQdYaQE8vCGtEkzgo9ZQ3RP1dNCOvVU= X-Received: by 2002:a19:ad4b:0:b0:4cb:315d:e9b8 with SMTP id s11-20020a19ad4b000000b004cb315de9b8mr950189lfd.110.1672743539856; Tue, 03 Jan 2023 02:58:59 -0800 (PST) MIME-Version: 1.0 References: <20230102225656.GA3532398@roeck-us.net> <20230103014535.GA313835@roeck-us.net> In-Reply-To: From: Ard Biesheuvel Date: Tue, 3 Jan 2023 11:58:48 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Linux 6.2-rc2 To: Linus Torvalds Cc: Guenter Roeck , "Jason A. Donenfeld" , Yoshinori Sato , Rich Felker , Arnd Bergmann , Linux Kernel Mailing List , Masahiro Yamada , Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 Jan 2023 at 03:13, Linus Torvalds wrote: > > On Mon, Jan 2, 2023 at 5:45 PM Guenter Roeck wrote: > > > > ... and reverting commit 99cb0d917ff indeed fixes the problem. > > Hmm. My gut feel is that this just exposes some bug in binutils. > > That said, maybe that commit should not have added its own /DISCARDS/ > thing, and instead just added that "*(.note.GNU-stack)" to the general > /DISCARDS/ thing that is defined by the > > #define DISCARDS .. > > a little bit later, so that we only end up with one single DISCARD > list. Something like this (broken patch on purpose): > > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -897,5 +897,4 @@ > */ > #define NOTES \ > - /DISCARD/ : { *(.note.GNU-stack) } \ > .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ > BOUNDED_SECTION_BY(.note.*, _notes) \ > @@ -1016,4 +1015,5 @@ > #define DISCARDS \ > /DISCARD/ : { \ > + *(.note.GNU-stack) \ > EXIT_DISCARDS \ > EXIT_CALL \ > > But maybe that DISCARDS macrop ends up being used too late? > Masahiro's v1 did something like this, and it caused an issue on RISC-V, which is why we ended up with this approach instead. > It really shouldn't matter, but here we are, with a build problem with > some random old binutils on an odd platform.. > AIUI, the way ld.bfd used to combine output sections may also affect the /DISCARD/ pseudo-section, and so introducing it much earlier results in these discards to be interpreted in a different order. The purpose of this change is to prevent .note.GNU-stack from deciding the section type of the .notes output section, and so keeping it in its own section should be sufficient. E.g., --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -896,7 +896,7 @@ * Otherwise, the type of .notes section would become PROGBITS instead of NOTES. */ #define NOTES \ - /DISCARD/ : { *(.note.GNU-stack) } \ + .note.GNU-stack : { *(.note.GNU-stack) } \ .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ BOUNDED_SECTION_BY(.note.*, _notes) \ } NOTES_HEADERS \ The .note.GNU-stack has zero size, so the result should be the same.