From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DEA7C2D0A3 for ; Mon, 26 Oct 2020 16:03:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DF62722400 for ; Mon, 26 Oct 2020 16:03:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ld+c8lhy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF62722400 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AbMbuB8S3F817lSnwly0IncrrJF+yoA/1nspdmj5iiM=; b=ld+c8lhyc2UmGEkuIPAeeRfgD vFWP5SYWgUBM3lsQRfFcOSGt2Kfa2Qax1XE2yeflpcE448U+o9jzAhlIHpMDgSoqaciRLd/VqAHOX VU6XJq3uGQqAe1UpX2pdgNeanh7SLWuIsLCvaxEWfATjtY07J8PUbxkLaOaxQb5iDjEzjexSWwcdb BudEP6oXlgXp5R35Owrbd15rm95D1l3746aCCAl8Q9oGJsgbGmqQiw+lGwvfxKFlmthnz45BdfUlu kvnzGNFobsyc2x2qILIPYbjUHRZfZ5VWKwISfgc+VJG6ucSfHSp00nkvyhSO2BQf0a/D6/3ARlqku dnrYaizZw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX4wG-0002H7-CO; Mon, 26 Oct 2020 16:01:40 +0000 Received: from mail-ot1-f68.google.com ([209.85.210.68]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kX4wC-0002FU-Ou for linux-arm-kernel@lists.infradead.org; Mon, 26 Oct 2020 16:01:37 +0000 Received: by mail-ot1-f68.google.com with SMTP id k68so8415171otk.10 for ; Mon, 26 Oct 2020 09:01:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=asUJBtXsqUx3cRgU1NNSgl2otnJ/rjwe37VOtYFH0nY=; b=iOZ86Oj15MA91wvJ7QHyxYnyhP2jElayf/i12Ii8LC4l9Nx58Zn1M84wqvYMPuyVcX EcbG/CZiDGeU7t5PMM170gM2pWp7a3IXlF4yFINyJLnX77idpVsNAxF99TbfX2vTLrq9 iWL0cOz07CafpokNmuOC0jnnKpJ/tT9kZ6AVf5E6vYag9zS3QF1g30g6wYVFgGeqDiig pkCSJwAnLtFjCyNe9N/51abuCdRB+50/iOwPstSmAKbbq2sLJt5I0SccnVSpRp5KtxAP 09nk3kIQN6JrQ1trSbdYrTRb7Kjx1g5v3BQ4a+FFPeUFZU36EktZ7u1n84Jzdh1qJjwy hpmQ== X-Gm-Message-State: AOAM531c37pAaXiNr9Os3u/4d26TYI2+2XJv+/KcA/sgsVmdhA0gZz3S kfDBj7pb+NRe5jlkl/qS+uP5o5h40ZMZtHvbhS8= X-Google-Smtp-Source: ABdhPJxPI+usSlZbZdx1IIlBwkjAFNrQaHoxsJAFSYYUxD2jVsGeXmh3ZzBEHoa089xtWunX1BF5lEiWHp0IZeVW1xM= X-Received: by 2002:a9d:5e14:: with SMTP id d20mr11342816oti.107.1603728095846; Mon, 26 Oct 2020 09:01:35 -0700 (PDT) MIME-Version: 1.0 References: <20200821194310.3089815-1-keescook@chromium.org> <20200821194310.3089815-14-keescook@chromium.org> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 26 Oct 2020 17:01:24 +0100 Message-ID: Subject: Re: [PATCH v6 13/29] arm64/build: Assert for unwanted sections To: Kees Cook X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201026_120136_833337_291046B4 X-CRM114-Status: GOOD ( 25.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Linux-Arch , linux-efi , Linux Kernel Mailing List , Arnd Bergmann , Catalin Marinas , Masahiro Yamada , the arch/x86 maintainers , Nick Desaulniers , Russell King , Ard Biesheuvel , Linux-Renesas , clang-built-linux , Arvind Sankar , Ingo Molnar , James Morse , Nathan Chancellor , Borislav Petkov , Peter Collingbourne , Ingo Molnar , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 26, 2020 at 2:29 PM Geert Uytterhoeven wrote: > On Mon, Oct 26, 2020 at 1:29 PM Geert Uytterhoeven wrote: > > On Fri, Aug 21, 2020 at 9:56 PM Kees Cook wrote: > > > In preparation for warning on orphan sections, discard > > > unwanted non-zero-sized generated sections, and enforce other > > > expected-to-be-zero-sized sections (since discarding them might hide > > > problems with them suddenly gaining unexpected entries). > > > > > > Suggested-by: Ard Biesheuvel > > > Signed-off-by: Kees Cook > > > > This is now commit be2881824ae9eb92 ("arm64/build: Assert for unwanted > > sections") in v5.10-rc1, and is causing the following error with > > renesas_defconfig[1]: > > > > aarch64-linux-gnu-ld: warning: orphan section `.eh_frame' from > > `kernel/bpf/core.o' being placed in section `.eh_frame' > > aarch64-linux-gnu-ld: Unexpected GOT/PLT entries detected! > > aarch64-linux-gnu-ld: Unexpected run-time procedure linkages detected! > > > > I cannot reproduce this with the standard arm64 defconfig. > > > > I bisected the error to the aforementioned commit, but understand this > > is not the real reason. If I revert this commit, I still get: > > > > aarch64-linux-gnu-ld: warning: orphan section `.got.plt' from > > `arch/arm64/kernel/head.o' being placed in section `.got.plt' > > aarch64-linux-gnu-ld: warning: orphan section `.plt' from > > `arch/arm64/kernel/head.o' being placed in section `.plt' > > aarch64-linux-gnu-ld: warning: orphan section `.data.rel.ro' from > > `arch/arm64/kernel/head.o' being placed in section `.data.rel.ro' > > aarch64-linux-gnu-ld: warning: orphan section `.eh_frame' from > > `kernel/bpf/core.o' being placed in section `.eh_frame' > > > > I.e. including the ".eh_frame" warning. I have tried bisecting that > > warning (i.e. with be2881824ae9eb92 reverted), but that leads me to > > commit b3e5d80d0c48c0cc ("arm64/build: Warn on orphan section > > placement"), which is another red herring. > > kernel/bpf/core.o is the only file containing an eh_frame section, > causing the warning. > If I compile core.c with "-g" added, like arm64 defconfig does, the > eh_frame section is no longer emitted. > > Hence setting CONFIG_DEBUG_INFO=y, cfr. arm64 defconfig, the warning > is gone, but I'm back to the the "Unexpected GOT/PLT entries" below... > > > Note that even on plain be2881824ae9eb92, I get: > > > > aarch64-linux-gnu-ld: Unexpected GOT/PLT entries detected! > > aarch64-linux-gnu-ld: Unexpected run-time procedure linkages detected! > > > > The parent commit obviously doesn't show that (but probably still has > > the problem). Reverting both b3e5d80d0c48c0cc ("arm64/build: Warn on orphan section placement") be2881824ae9eb92 ("arm64/build: Assert for unwanted sections") seems to solve my problems, without any ill effects? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel