Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp425597pxa; Fri, 31 Jul 2020 16:18:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt/Y2H7nHvRDeH2h2xvFDx9BNIbiNdGAJS6jjE1B1QZf1i4Tu+pu5+hsMfj8WU0zLqRYxW X-Received: by 2002:a50:8f83:: with SMTP id y3mr6167655edy.257.1596237533264; Fri, 31 Jul 2020 16:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596237533; cv=none; d=google.com; s=arc-20160816; b=Cu2pZEhyvLsEqW7gE5AaFtLkUSkl6vyEjTls/FJWzzSQC4E2do7fprq385IJNUHGBk RCVyJKUQBQWbp7s79oFhNTBKUJ73j713WUoL48UXzr22R180d73sHuWb7UhA6NSxrxp3 CZHQSpfGzVzAlxq5PXAd5IBsTb6IJd8H0q9tzS/g9UlSbKSeJZdRNnQ20m0dprVK27yk k5IWo0bqRR06motxdlIDMbfHOYaG3+qxelyxRF2huv2YL3Z7gddnMgeLmCKnYJRqTnFK ZO7VuPz6+/RBBi1kTAzHTX4d7i7WEM6gwvhaWkZJR1KHvG+Zx8D4ZdliWu+iKbOyLDI0 eNYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aNMQ3F5q4g/Uk/+s5Q6WGurCwVwunmhXKYzGhkTYsIo=; b=y5tCINOzw3YLmK6zonht511daxyOkDDJgHTlXCkGViagikEon+6P5Adi22lWznDUYI INzfbmZFpaKkDowrEoHeA3TQWUY8reOgt4UrcmDyA9lQP++JW6V0XE1whavx9ZxYCicQ yfiWsooOuzEd8MJuzdS4OL6QwpMHqPp3B4UL6Hpck9APUdoR7j5/JpKKFITnjIjh55gZ kICf8n4+O9lFgVX9R4fK9oifYmCx8krMMt83wDZD1R892hyvksdqSg3wnjjVO8miIwba HRLb95qFIdJU4DJ9kkFGBTCUeFc52GgJ84iwKQveqGQ/4HekJcSKPRjI+Cy7QDEWv+fH QXhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=V7pRW5Z7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si6123195ejf.537.2020.07.31.16.18.30; Fri, 31 Jul 2020 16:18:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=V7pRW5Z7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727933AbgGaXSX (ORCPT + 99 others); Fri, 31 Jul 2020 19:18:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727917AbgGaXSU (ORCPT ); Fri, 31 Jul 2020 19:18:20 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A7DEC061757 for ; Fri, 31 Jul 2020 16:18:20 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id t6so16807233pgq.1 for ; Fri, 31 Jul 2020 16:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aNMQ3F5q4g/Uk/+s5Q6WGurCwVwunmhXKYzGhkTYsIo=; b=V7pRW5Z7AEZ48SyrjJClnXGtKhu5EXaa5sPdFxXji+oSze06iySj2l5uugTpF2w+s6 /0KYMS5jXvAmb+nfHzJpH6+Sv4YKDO9YCEORcsU3J8MUXjDft+0+ROx3pCqSgYEc/2eY VTjWB8RxvO2SCARRO2VidQkHRol/MW6eL3Ot8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aNMQ3F5q4g/Uk/+s5Q6WGurCwVwunmhXKYzGhkTYsIo=; b=eMkr5d2ysZ5m+GdRxo5+XjQkw418j7e647QXdWOqdgKc/t+FbSXz9lpN+6Gg2fbL/E BAo8ZOQpcaWcnOGSSs8MvkQ5O167pwmmLXSMGdFv4qS4ft/1VoUvNrl4uVS0ps4XGHT4 b5pZOSiOnCt1E2qAv0nKWmKy6DOL9t7gAsksStjuU53FiUDh5Ovj2jjPEf9ETYI2NUPJ CbNcCjlS6j2yDrc9nnuypM2Jw+XO8ch1wZYrTGc6g3WjM6Aof3rLzMa6KEgxU4W/LLbY yOoXG0QRqH6WtigeNaw7uRqyZuzuy2Oka7Ongxj3EkGDgfaXvFPPFXq8e8T6mrarGZF8 AA/Q== X-Gm-Message-State: AOAM533d+yf7S/CksasLqiMNexO13XjKWyYzQlHOw1iugPOjkxiRn+k7 Ox5JwRAVCeJRhJrVp/16wXlxjA== X-Received: by 2002:a63:3c55:: with SMTP id i21mr5799731pgn.93.1596237500020; Fri, 31 Jul 2020 16:18:20 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c134sm11221511pfc.115.2020.07.31.16.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 16:18:16 -0700 (PDT) From: Kees Cook To: Thomas Gleixner , Will Deacon Cc: Kees Cook , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nick Desaulniers , Nathan Chancellor , Arnd Bergmann , x86@kernel.org, clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 22/36] arm/build: Refactor linker script headers Date: Fri, 31 Jul 2020 16:08:06 -0700 Message-Id: <20200731230820.1742553-23-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200731230820.1742553-1-keescook@chromium.org> References: <20200731230820.1742553-1-keescook@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for adding --orphan-handling=warn, refactor the linker script header includes, and extract common macros. Signed-off-by: Kees Cook --- arch/arm/{kernel => include/asm}/vmlinux.lds.h | 13 ++++++++----- arch/arm/kernel/vmlinux-xip.lds.S | 4 +--- arch/arm/kernel/vmlinux.lds.S | 4 +--- 3 files changed, 10 insertions(+), 11 deletions(-) rename arch/arm/{kernel => include/asm}/vmlinux.lds.h (96%) diff --git a/arch/arm/kernel/vmlinux.lds.h b/arch/arm/include/asm/vmlinux.lds.h similarity index 96% rename from arch/arm/kernel/vmlinux.lds.h rename to arch/arm/include/asm/vmlinux.lds.h index 381a8e105fa5..a08f4301b718 100644 --- a/arch/arm/kernel/vmlinux.lds.h +++ b/arch/arm/include/asm/vmlinux.lds.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#include #ifdef CONFIG_HOTPLUG_CPU #define ARM_CPU_DISCARD(x) @@ -49,8 +50,12 @@ EXIT_CALL \ ARM_MMU_DISCARD(*(.text.fixup)) \ ARM_MMU_DISCARD(*(__ex_table)) \ - *(.discard) \ - *(.discard.*) + COMMON_DISCARDS + +#define ARM_STUBS_TEXT \ + *(.gnu.warning) \ + *(.glue_7) \ + *(.glue_7t) #define ARM_TEXT \ IDMAP_TEXT \ @@ -64,9 +69,7 @@ CPUIDLE_TEXT \ LOCK_TEXT \ KPROBES_TEXT \ - *(.gnu.warning) \ - *(.glue_7) \ - *(.glue_7t) \ + ARM_STUBS_TEXT \ . = ALIGN(4); \ *(.got) /* Global offset table */ \ ARM_CPU_KEEP(PROC_INFO) diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index 3d4e88f08196..904c31fa20ed 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S @@ -9,15 +9,13 @@ #include -#include +#include #include #include #include #include #include -#include "vmlinux.lds.h" - OUTPUT_ARCH(arm) ENTRY(stext) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 5592f14b7e35..bb950c896a67 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -9,15 +9,13 @@ #else #include -#include +#include #include #include #include #include #include -#include "vmlinux.lds.h" - OUTPUT_ARCH(arm) ENTRY(stext) -- 2.25.1