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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable 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 2DC63C433DF for ; Mon, 29 Jun 2020 20:05:29 +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 03AFE20899 for ; Mon, 29 Jun 2020 20:05:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="luEggWu3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BHyUKkY7"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="Im8v5EGy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03AFE20899 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com 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=5npIfc66UOYddZo+mtMCAcK2FQbj/RX90viohZOF2bQ=; b=luEggWu341riOPVNPTpnpt4a8 nm45B6Jh8fMuBFfM9NzcF77BPb7/UvDueeNMnBf8XvI8eMcQ/Mf7emq4Y0ivSNcp9EOHfHeWgCGiy I9oSBRHK+yUWh9rQ1bnhpXVvL4Ni5GmK5939W2pwNk9pzArfrbEArzSDRLfPVovcFpCgIxmo8XerX 2Mm6rIok8NOhf+MRtAsMJxY2KuROHSF8BeTHpWNquLh696pwNADNGoJGb9za4O7g6cQ/TyWsbf4kn g6dPlno8vwEZAw2uhycKWzWRk6r9BVZ69nI/bvnpQsNYWxiFIoOiTNsb0D4utm46PFF4nQrPzs6zW hyMYAnmxA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jq00U-0002A3-EK; Mon, 29 Jun 2020 20:03:58 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jq00S-0001uW-G1 for linux-arm-kernel@merlin.infradead.org; Mon, 29 Jun 2020 20:03:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:Cc:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1gz1zQHU9+r/YpON9C/k1EX29gyKSkYfOsfpz38zwBA=; b=BHyUKkY7sPMIe5iARX5lQJDQOT zjx/cswnqQm0zpHFOMrsZXgf20G6JRtbxZ+YQ0uhiP593OEMp2rCPssVlMkVetT5Ix9zXS2UVCB3S feuVU9+IF6EtefbDLbWu5tJmIW0o4fMJrboWPE+st+hM2Ic4vox1y4XQnp90F7m2TnGhMuJk+AgiQ GzbsbPY8rvGeXbNDNgZxemCB121WHO4Li016mZGywNIXNonw1GNvG7qeJ7VLE8EkIA8kWRvvCL1EB Czc3eXN6vWr8pONG4/G4cUrtRMSfzIO9P0x7koQrE/ajcjK/mtieTbU2WM1ux46wFNy2WQlju1K2J PpWtafNQ==; Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpzkM-0005Gx-T3 for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 19:47:24 +0000 Received: by mail-pl1-x641.google.com with SMTP id bj10so2267187plb.11 for ; Mon, 29 Jun 2020 12:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1gz1zQHU9+r/YpON9C/k1EX29gyKSkYfOsfpz38zwBA=; b=Im8v5EGyC2StppMSLYm6OQn+oLGyJfaUm6K7ize3Z/Umh4ZYnOr1TcUmPi9B+HpLUQ cLC2XsUaCI472AeGUmVPqaS4Bmla9oHo9I+AIWRkU0tKMAkgxKOPmsmCHTRZotVKURc+ 3Ej3S2v2UMRKvyl3Q/MUcNjQN9lw0K08BG3VVAlkAHIGdIZymVTArWa791V22RfReKvK d4Xn9SrFlNP5F7C5P+8Tu8DV3TMfCi8RkBELIdz9ah/XgEYZ0E2gxGyacBn2DlN9d4M/ w6i7bvKZcnFz+1hsf9o46nd5nuTk8SAC+MJFu9ob0741d4CQ4emNSBIyIp+27VDHdBTP 6/hg== 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=1gz1zQHU9+r/YpON9C/k1EX29gyKSkYfOsfpz38zwBA=; b=ZjqRd2zH72+zJKAiMDe8qckB4/F2mWzlj4TrhEerQW+wxeeV5qbqxTGO2wT3z6qKPZ /27Ry4R3gjKkYd4FqrYymdlYipd3lL/SDBAYA1XmLRgkZY4ZEiJMGBParUV8OIterHCR Wwo4rxG+JCz8HrOADugMmUV0xGqFt/nkFDsJ+ZvDULhJj65fsEO8e7dWBe1edYKrfqk2 XnPcm8Ew7vxMaZIRDlcgom3a8ktvr48YYuXcHyjd3vcMB4MJn1YeaylDtEyeVMTAIvQK 2k5B/VO7Va2hFKtjVwgboacXlK4cGxjostwKjWEbA9RZ1f+N/++x5VKjFJOZF6vWlvtU 9zCQ== X-Gm-Message-State: AOAM533Tjclp3h4C4DJmAoF0GhGOn4d6gUKIX19rfBRdKQl6SJv1WD2G 0mAAPoPPktk4qoaIl5GdhSMPF7dwEXE9NDbyVtye4g== X-Google-Smtp-Source: ABdhPJxD+NDMzpTLVtkwIahVlE1Ojd9ohblWdC3y8HeoT1NdlP3ApesamY48WnXvCXAzV3iGs4MYCMe98HbhJvlJHpE= X-Received: by 2002:a17:90a:30ea:: with SMTP id h97mr18995233pjb.32.1593460035317; Mon, 29 Jun 2020 12:47:15 -0700 (PDT) MIME-Version: 1.0 References: <20200629061840.4065483-1-keescook@chromium.org> <20200629061840.4065483-15-keescook@chromium.org> In-Reply-To: <20200629061840.4065483-15-keescook@chromium.org> From: Nick Desaulniers Date: Mon, 29 Jun 2020 12:47:03 -0700 Message-ID: Subject: Re: [PATCH v4 14/17] arm/build: Warn on orphan section placement To: Kees Cook X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200629_204719_420931_4DDB0A6F X-CRM114-Status: GOOD ( 24.27 ) 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 , Arnd Bergmann , Peter Collingbourne , Catalin Marinas , Masahiro Yamada , "maintainer:X86 ARCHITECTURE \(32-BIT AND 64-BIT\)" , Russell King , LKML , Nathan Chancellor , clang-built-linux , Arvind Sankar , Ingo Molnar , James Morse , Thomas Gleixner , Borislav Petkov , Will Deacon , Ard Biesheuvel , 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 Sun, Jun 28, 2020 at 11:18 PM 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 named in the linker > script. > > Specifically, this would have made a recently fixed bug very obvious: > > ld: warning: orphan section `.fixup' from `arch/arm/lib/copy_from_user.o' being placed in section `.fixup' > > Discard unneeded sections .iplt, .rel.iplt, .igot.plt, and .modinfo. > > Add missing text stub sections .vfp11_veneer and .v4_bx. > > Add debug sections explicitly. > > Finally enable orphan section warning. > > Signed-off-by: Kees Cook Thanks for following up on the previous suggestion regarding .glu_7 / .glu_7t ordering. LGTM Reviewed-by: Nick Desaulniers > --- > arch/arm/include/asm/vmlinux.lds.h | 6 +++++- > arch/arm/kernel/vmlinux-xip.lds.S | 1 + > arch/arm/kernel/vmlinux.lds.S | 1 + > 3 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/include/asm/vmlinux.lds.h b/arch/arm/include/asm/vmlinux.lds.h > index c66b16cd8837..d44fae722e7a 100644 > --- a/arch/arm/include/asm/vmlinux.lds.h > +++ b/arch/arm/include/asm/vmlinux.lds.h > @@ -39,6 +39,8 @@ > __idmap_text_end = .; \ > > #define ARM_COMMON_DISCARD \ > + *(.iplt) *(.rel.iplt) *(.igot.plt) \ > + *(.modinfo) \ > *(.discard) \ > *(.discard.*) > > @@ -63,7 +65,9 @@ > #define ARM_STUBS_TEXT \ > *(.gnu.warning) \ > *(.glue_7) \ > - *(.glue_7t) > + *(.glue_7t) \ > + *(.vfp11_veneer) \ > + *(.v4_bx) > > #define ARM_TEXT \ > IDMAP_TEXT \ > diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S > index 57fcbf55f913..11ffa79751da 100644 > --- a/arch/arm/kernel/vmlinux-xip.lds.S > +++ b/arch/arm/kernel/vmlinux-xip.lds.S > @@ -150,6 +150,7 @@ SECTIONS > _end = .; > > STABS_DEBUG > + DWARF_DEBUG > ARM_DETAILS > } > > diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S > index 1d3d3b599635..dc672fe35de3 100644 > --- a/arch/arm/kernel/vmlinux.lds.S > +++ b/arch/arm/kernel/vmlinux.lds.S > @@ -149,6 +149,7 @@ SECTIONS > _end = .; > > STABS_DEBUG > + DWARF_DEBUG > ARM_DETAILS > } > > -- > 2.25.1 > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200629061840.4065483-15-keescook%40chromium.org. -- Thanks, ~Nick Desaulniers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel