Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11798528rwl; Tue, 3 Jan 2023 05:03:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXsWarg0B11l1N96tMqMubbthiOy2ovLED3aev0dc2S7bFyS9zCgQ8AHiieekiHkbzYWLh23 X-Received: by 2002:a17:907:7844:b0:7c0:eba2:f9dd with SMTP id lb4-20020a170907784400b007c0eba2f9ddmr36988657ejc.53.1672750994228; Tue, 03 Jan 2023 05:03:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672750994; cv=none; d=google.com; s=arc-20160816; b=YDxA0py9HRWRWnrAge/MD39ofugJEqUOdWauMYF5NzPTFqRTNhjOYP5ZRZQ3i0glCd X+0vtNZ0tWrIETbaeFjknRST6nJH4cQsfBDTuxGsG9hlMwHwwWfn08hXQSwbnOLSidrL jkD/SYPary+f1C9Zohi4Imxzv5l6VHEygRlFbcUcoQRPOpJ774HXIEyZK+0Lp1FgJqxs vWSesG1XjGXqo9qyM0WWuvDHf6zlkBzAesF2+DEkTJUH20UU50AkGpdBdpS6idN2DhvN l75uC1DALOZFlxJcuvISU4zDdMPBrUNQmWRJ+KxxX5IDimgif0+ckVzQWdeHBKivS/uT WPBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=jLTca1gX9g6fgPyk87rTl4KumqmJHjz23Fu2HgF4fpU=; b=oxnZILxsGkADalTEwDWv3n+24ZD3JV0vBXMFVk58lMXM92UdfMkondWurBfl6wh0FZ 6moSjtYxK0kmWnEqBs7gBtOCd2ph4Zsea4ZHpVHuPhYorgmdSchmTIsI/xrc+JDiDCVW 7rHUhsOEpO9EEg5TIGqvmWz5FihC9GhPBY4P3/j9TkSlQUHHsmy8EjAkaP0pV4qxWTmk hMR16jOrSMm0tDwo7kJx8094PIZQribCB3m319tEBPxnlEL6I5kd9g+5eNf7UBgCwKbl 2MMaCify4RaVqmj2O1uJLuOtkpsQPxqjzwHWpsEbhpckp52KU2xLR/bPrQO96+M3XMOc bGzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=K7uD8cPJ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r19-20020a05640251d300b00469fd4323a4si30159472edd.246.2023.01.03.05.02.54; Tue, 03 Jan 2023 05:03:14 -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=@gmail.com header.s=20210112 header.b=K7uD8cPJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237489AbjACMW0 (ORCPT + 60 others); Tue, 3 Jan 2023 07:22:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbjACMWV (ORCPT ); Tue, 3 Jan 2023 07:22:21 -0500 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5F5FF017 for ; Tue, 3 Jan 2023 04:22:20 -0800 (PST) Received: by mail-oi1-x236.google.com with SMTP id n8so20173360oih.0 for ; Tue, 03 Jan 2023 04:22:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=jLTca1gX9g6fgPyk87rTl4KumqmJHjz23Fu2HgF4fpU=; b=K7uD8cPJEJdLlIOweJyH+gkLNEn8O96uE77Gcq4itN88ByyVPVGSJJfgm1nzlu0twe jSRWv6wMRxv4IW8YvDtr4l9+yth9HpeorflFJlKlHJWCl+cT22u52M1VIZdWnRO5WwDI XH9VAyTiSBt0K8/tuYGvBZyRomsEBm/TukHhl+06TKVqOB8A7ZM+A9T/IxdIcojwlW1s 6ZA/l7VxyITeSUh20A0rKy2mhoei+UH3LqOpO4ArYSK5CNWGkrK7n+lJYipsvkFP+TGI TWOs97j5KIGtNn/yROsxIzhC2w0Byyo2EskisOvhkxS+LqZefEw/Bh9qtExy/1JkFVrf aM1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jLTca1gX9g6fgPyk87rTl4KumqmJHjz23Fu2HgF4fpU=; b=qvmA48N8dtjmwjTRJ7WrGgFSI06+sP1QZF7h9oUNq5kcLjAtqAqDynAAkV5KH+zUyq T6bGPuuNgMETwid0MZKzlpeIna1rzQUxJir8W+LLhAwDOVXHJwT1NFpGoZKdGRmBU9Mi TahGRk+exY0k0OmB61uKvyjg+J0kTclrg4zAq7bmc6BQUlZoaPoQQHnY1oLWO4WE9CaP 0FDZwUSdQR+XbaDcvIU716dTUrlH5JIwqCpXoH4KSmeHRg5p0Ojz1W5DJEZk2w8etY8S USZGJab+DGN/NXNjwgH2ywkFWfSgQsN4s9yYf6sKPPAAxrzyIMCpNAOyKn1J2/o4hS16 m4yw== X-Gm-Message-State: AFqh2kq6Q+mevmthJCT8TL3qpGGcgddPIGryAGjf+z4d3wQkNNTbzPeo jwVgDT5u7VjdIXasqsTnwQQ= X-Received: by 2002:a05:6808:2082:b0:35e:93bf:a9bb with SMTP id s2-20020a056808208200b0035e93bfa9bbmr33973789oiw.13.1672748540046; Tue, 03 Jan 2023 04:22:20 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id j12-20020a9d7f0c000000b00660fe564e12sm14724792otq.58.2023.01.03.04.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 04:22:19 -0800 (PST) Sender: Guenter Roeck Date: Tue, 3 Jan 2023 04:22:17 -0800 From: Guenter Roeck To: Ard Biesheuvel Cc: Linus Torvalds , "Jason A. Donenfeld" , Yoshinori Sato , Rich Felker , Arnd Bergmann , Linux Kernel Mailing List , Masahiro Yamada , Palmer Dabbelt Subject: Re: Linux 6.2-rc2 Message-ID: <20230103122217.GA190111@roeck-us.net> References: <20230102225656.GA3532398@roeck-us.net> <20230103014535.GA313835@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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, Jan 03, 2023 at 11:58:48AM +0100, Ard Biesheuvel wrote: > 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. The above fixes the problem for sh. Guenter