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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 0880DC43461 for ; Tue, 8 Sep 2020 20:19:05 +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 8D05E208FE for ; Tue, 8 Sep 2020 20:19:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mNok9LZS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qZ/9AznD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D05E208FE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alum.mit.edu 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OXurTUd64ZC67ROImC9rn40Apbe8Jt9fQH98via0hj8=; b=mNok9LZSCIcimZXel1jXum2pC SLBF87eeGg5DtdMputz7Z+X+R0ls4ERHl3fvxG983VTotD/2gXJhVAkntH7k7MXhVNIj0/0dQYkW/ 5g+P6EPu4OzhlGWZO5uUJIMEA0RfvyMwl3oq5UyUQzRpFIh0TY0YPZSt4FL+L1EkppxnYLEv3nFfC je9HwsgC096Ikr0mRVzBGoZQbw52w654Bji9adg4+BnpjkjbLyoGMRJUFOcHlGUpeOiV86xxGu7bH pdvrbX/tjKNCQffVnBSe4JkadTFC5fiuf+v/6WR+TgbQ4jVQJMfcdL22cKDSt08TnBrDN8N5PFGDI 6PSfIOlgg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFk3i-0001Tf-ON; Tue, 08 Sep 2020 20:17:42 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFk3g-0001Sp-24 for linux-arm-kernel@lists.infradead.org; Tue, 08 Sep 2020 20:17:40 +0000 Received: by mail-qk1-x743.google.com with SMTP id o5so325280qke.12 for ; Tue, 08 Sep 2020 13:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/08OEII2Gc2davobAmINkHdHlTLoM3yBel115LZWEGE=; b=qZ/9AznDVXFtr6CrHuhiw4QW5HmClw8tl/kn16sP+vAL9BwyB1TalbAKldIgIIFtb+ 4gbcw6Ixl7WWm6+eR7AOeeEgNHRd9KO82LOanYAhZnktvDEwnWkiDthqJWrrSp8D42u4 fIeAiy4POw3wf4Z6SvhKEEye1aUrwOIWslhBv+79RaCXHWn4YpCcP2k1rJp/fR64lnQC 8jnqEJ5IzfX5q10Y72vrRW9J8/NnBj7zCdAZsoK7DHNMvg7HjynBh+r4iRBw+V66mCG0 KesRtoiYqBsl5xile5AfugcBIKBCC3vQzS/rH6rs/JmItACffhMLEWNQHzOwlPtwLyAt KhyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=/08OEII2Gc2davobAmINkHdHlTLoM3yBel115LZWEGE=; b=VPYwWMzpK5ZIYOgWnDCL7855V/olPWWXKu5eDd28dWDM0oBkd9nQI2IPgxrUssyi9x xBVltqMC57OfRSpRPsxb5MFow3NebVdr2pYPt04tF/ObhQ4/OJc+MFF49aNOsAvcmtS6 p0cqbrZX6s9Q+LhjxqhCd7pYGnuGnVmRXe04qoBNFHxn7WCU7iKPxvjf52WejBoOVl4P QpgbBXOE5l5EXuXPBd5sAVVGHqnEdbMItl6Uu81/ARaXcqNxz/rh4ACeBgHAEinJjSEM V6/kwhfsJdrdYf+xrOoT0ZAINmO8IcdlIsQROorqE4PZvpWlMYh0Wthb+I6bdlS5GUBS 7TSg== X-Gm-Message-State: AOAM532drVdcJk5H3L1lmFfASnW8XJjuoKaCDPWgAVnq7Ru0u3exCtTN mwbVqFhTN7r/wNFzBVm0jkY= X-Google-Smtp-Source: ABdhPJwNSgWEhWS2D5NSJFniOHBOS9/EWNgGqZsCsA91Ij4q3VjCGMYQaXbuPxF07dtwVNjz7gPPBQ== X-Received: by 2002:a05:620a:955:: with SMTP id w21mr302081qkw.69.1599596256656; Tue, 08 Sep 2020 13:17:36 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id z6sm335661qkl.39.2020.09.08.13.17.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 13:17:35 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 8 Sep 2020 16:17:34 -0400 To: Arvind Sankar Subject: Re: [PATCH v7 4/5] x86/build: Warn on orphan section placement Message-ID: <20200908201734.GA87825@rani.riverdale.lan> References: <20200902025347.2504702-1-keescook@chromium.org> <20200902025347.2504702-5-keescook@chromium.org> <20200905224835.GA1500331@rani.riverdale.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200905224835.GA1500331@rani.riverdale.lan> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200908_161740_107656_E8ACF2FB X-CRM114-Status: GOOD ( 22.00 ) 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@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Arnd Bergmann , Catalin Marinas , Masahiro Yamada , x86@kernel.org, Nick Desaulniers , Russell King , Ingo Molnar , clang-built-linux@googlegroups.com, Ingo Molnar , James Morse , Nathan Chancellor , Borislav Petkov , Peter Collingbourne , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org 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 Sat, Sep 05, 2020 at 06:48:35PM -0400, Arvind Sankar wrote: > On Tue, Sep 01, 2020 at 07:53:46PM -0700, Kees Cook wrote: > > We don't want to depend on the linker's orphan section placement > > heuristics as these can vary between linkers, and may change between > > versions. All sections need to be explicitly handled in the linker script. > > > > Now that all sections are explicitly handled, enable orphan section > > warnings. > > > > Signed-off-by: Kees Cook > > --- > > arch/x86/Makefile | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/arch/x86/Makefile b/arch/x86/Makefile > > index 4346ffb2e39f..154259f18b8b 100644 > > --- a/arch/x86/Makefile > > +++ b/arch/x86/Makefile > > @@ -209,6 +209,10 @@ ifdef CONFIG_X86_64 > > LDFLAGS_vmlinux += -z max-page-size=0x200000 > > endif > > > > +# We never want expected sections to be placed heuristically by the > > +# linker. All sections should be explicitly named in the linker script. > > +LDFLAGS_vmlinux += $(call ld-option, --orphan-handling=warn) > > + > > archscripts: scripts_basic > > $(Q)$(MAKE) $(build)=arch/x86/tools relocs > > > > -- > > 2.25.1 > > > > With LLVM=1 and GCOV_KERNEL/GCOV_PROFILE_ALL enabled, there are > .eh_frame sections created. I see that KASAN and KCSAN currently discard > them. Does GCOV actually need them or should it also discard? > > Thanks. Also, with LLD 10.0.1 which is going to be the minimum supported version, the relocation sections etc still generate warnings. ld.lld: warning: arch/x86/video/built-in.a(fbdev.o):(.rela.orc_unwind_ip) is being placed in '.rela.orc_unwind_ip' ld.lld: warning: .tmp_vmlinux.kallsyms2.o:(.rela.rodata) is being placed in '.rela.rodata' ld.lld: warning: :(.bss.rel.ro) is being placed in '.bss.rel.ro' ld.lld: warning: :(.eh_frame) is being placed in '.eh_frame' ld.lld: warning: :(.symtab_shndx) is being placed in '.symtab_shndx' _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel