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=-10.0 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 0C24CC433E2 for ; Sat, 5 Sep 2020 22:50:21 +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 5A01120797 for ; Sat, 5 Sep 2020 22:50:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="0jTVennx"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i2sjWJ41" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A01120797 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=zajBl2L6U7/QrWH8a78MdrjC3Sm/2RciTSA6bV/NAek=; b=0jTVennxEtGR1M50T3QmmkdKe yvi91Td5YwQarEVHDg3vpiPRLBlOFE+KQ6rB2hlg4Ezn092JDueKUIZwuk2TWt92nnj0pzXGttsP+ l4rqJebvBkREexv/UZMdiRr6duvbYuIKNZdTVVvgMxkOEUINL7+OdhUkIGhuusPADqw8BwRPFtdo2 H9zJIUbHvJQ1+e7uG2UB3uR8N8x+a+2H112LmdNcXm7R41bum9xF3C6ZIVsHII0jVz8Jtw2L9PDO7 IkkwSX/swsWso5XZGPtmgYlsBZQr5pddFuuWvcOCT50LJm/o1FbSl24tyOS1XgoKy6h+bLrFH6Yso jYyu3icnQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEgzI-0000eS-Ts; Sat, 05 Sep 2020 22:48:48 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEgzG-0000cl-Vx for linux-arm-kernel@lists.infradead.org; Sat, 05 Sep 2020 22:48:47 +0000 Received: by mail-qt1-x844.google.com with SMTP id v54so7491515qtj.7 for ; Sat, 05 Sep 2020 15:48:40 -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=dYL37oonxahMiERY6M7bI0fQzZLAfl7INM1zulnY34U=; b=i2sjWJ41j0LCW9MSNR1r+BVTos+aNU/sQNRWMGLG3Xma5GsC0JJOMnRi2RFJtAuqeZ 0lHzhBvxAsBMOF3NMXNMwQD+MuIZx5VzzycZN/qia173TCug2EPrmCp/1flJHsFHFloR 3VwMI8lSCupizstJ9n/tk5eH9GL5wojfKV9z2jtfNZI2gEbcRbZlgndrrSdimkuu3NM1 I50PNYQ9ZRV5w6K1nEe5yUUyjb+54T0D1PA3Cyds+//mrHOpI0X1ugO2t6yIT4THAprZ PEySoMqWEQwDcQTH3SGaEir1HOXMu+jm+kXFGkB+kxz9Qk3oB/KbAa6ykOY2+TF9iqFW JmZQ== 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=dYL37oonxahMiERY6M7bI0fQzZLAfl7INM1zulnY34U=; b=Kqf60DInl/1bXhCUTTpRr+zb8L8D8k5v8jTIodr2ZL73tcTaaN//bxpacJmUfN0TkA poHFhFPLyIA1Q9unRJlCV7gEMuzGjFZ3TIBxeJCSijgnQsaTzSr95uyksIjluHEFEiMk oWHS0WJbTjd2WVi7gUXMb4ha5sW/+I7kg2tV2BnydMElilKoYFFGDUaYsJeBQ05zRo1o xN7Q5UqsztqaKnG3JxZJ6S7LxF1zP+59cKpk3UW3nnZw6lnTKA5x98ggOJVaZKx773+F JyPKL4PwlcTLfkCp79dJoqq/5hL/E/iT8vVvWIfPzvS7QobhBOgBVyBU4Cvjgj8TdnzW LxKQ== X-Gm-Message-State: AOAM531BTYDOiwGS7Q6A1ewtqeX4aAu59sJH0GKd8Rwzpdc+DorNjNIo 9VPI1hs0EJEC1ztUXL6vv68= X-Google-Smtp-Source: ABdhPJzozlDPhyXr6JOZFagjTaiEP3QCjS39SNNHLMhx0wYBQR2VlcAzn6ysX8qJ/+qxrT46u/KrJA== X-Received: by 2002:ac8:fbb:: with SMTP id b56mr14999497qtk.307.1599346118622; Sat, 05 Sep 2020 15:48:38 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id d16sm8184604qte.19.2020.09.05.15.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 15:48:38 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Sat, 5 Sep 2020 18:48:35 -0400 To: Kees Cook Subject: Re: [PATCH v7 4/5] x86/build: Warn on orphan section placement Message-ID: <20200905224835.GA1500331@rani.riverdale.lan> References: <20200902025347.2504702-1-keescook@chromium.org> <20200902025347.2504702-5-keescook@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200902025347.2504702-5-keescook@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_184847_047671_81F7D608 X-CRM114-Status: GOOD ( 17.76 ) 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, Arnd Bergmann , Catalin Marinas , Masahiro Yamada , x86@kernel.org, Nick Desaulniers , Russell King , Ard Biesheuvel , clang-built-linux@googlegroups.com, Arvind Sankar , Ingo Molnar , James Morse , Nathan Chancellor , Borislav Petkov , Peter Collingbourne , Ingo Molnar , 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 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel