Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp425760pxa; Fri, 31 Jul 2020 16:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya2uqk/zVoslbxD1Omvpbzz7IGc6ydm69nMnqbuTAuX5OmbUqpA8SPKbK13cydBULPhR0o X-Received: by 2002:a17:906:4f0f:: with SMTP id t15mr6085467eju.337.1596237555627; Fri, 31 Jul 2020 16:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596237555; cv=none; d=google.com; s=arc-20160816; b=aX/PWh15KxNR7Y8CGo/l49uRXL6GIyRhWWz3uppXMBnO3KyREe+zeJ0ssf8uyjH3XC EyLVvpmXrdxEn29tsAgZftAcVu1IVEU1FHaFovo+kef36tzI0mhik4aPSkc+uB6KyidL SwvW8RRwVEsOEVBHJlHKJKTCGap23iuLM25X54NzB43XCaEYHFM4hdCw3AVHOOd3SN8B 4WQUBieByGAn7ZlryXHnKwh/rtPutVW5kaJQBoUoV3Nc+Bld+agTQ4et8r/TnCzF5WQf MLdisyMDZ94AdOqn8TlwypzgHhL4imrM/lxVZlbu/wuPYU6TEdNDzwPIcV/ZJZlnRhmk pZow== 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=ASfOQ/kuJ12Krf5ZSehq5O7QSVOARTcDMayUR4wNtMg=; b=fboLENqpRS/UxR1FSfhL/RQDckXmac46mjW0RKo8F9Hoe2tfO5yniTNsZF/r3/9wug V9phCpfD6gsqDPfSV1KIpExnfCK8VDDiXLQv78NfXBAnMXtg1Mmlj4dVOzwRa2Hzz3nc AcZMoZoACMpk3VacitlhNYDcCK/4CRgOFZe+hSmEYHuL+YK2uCH4qVwt3VBclwxl61pC AjwtDp1iyA7T5SfjPRlQStHpIYR5AeKR4e8t7eiuMvzgyJnuHgNB0YtXv6txrJDU/01r ifFRrMDQIWCRxbVHeEdc0hL80Y5yIpUf4VeGhTh9/CKc6JLjo3tLRTEgt3oFTFNgVoIo /fmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CBwwwhRe; 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 n12si6036364eji.301.2020.07.31.16.18.53; Fri, 31 Jul 2020 16:19:15 -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=CBwwwhRe; 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 S1728043AbgGaXSf (ORCPT + 99 others); Fri, 31 Jul 2020 19:18:35 -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 S1727840AbgGaXST (ORCPT ); Fri, 31 Jul 2020 19:18:19 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC918C061757 for ; Fri, 31 Jul 2020 16:18:17 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id i92so5823233pje.0 for ; Fri, 31 Jul 2020 16:18:17 -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=ASfOQ/kuJ12Krf5ZSehq5O7QSVOARTcDMayUR4wNtMg=; b=CBwwwhReWppNNFxkvHvxRIhoW1Pgu8rHz+Qem7CAjWQdaO5/GhluYGmbCsExNeTCUF GWVGhVmhGtziej1K0jwGNK4TJgftLk6BkDTi/Z0ZxQWg/3ennjOq71gQNscUJvF+p4mD yI8Dj9rogIG8+VxEZn7maN5u3Fg4sY5VJnsxM= 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=ASfOQ/kuJ12Krf5ZSehq5O7QSVOARTcDMayUR4wNtMg=; b=XGqToN2vCDyfx8PXlOg01MgrQyTt10QuYbYshMRpJoTSv5qMBA4Td9WHlE31ygtWIZ HYPeGWx41o8CraQkGd8/ckJoLHzSzacoTW+jkpei2dVeakX5t0NzGnihk9qASO3GAdVh 7hXh/KqpzUZThPLcgVlF+h4kGiAbbhRehyjQDGtaZS7RbbnUlUBkQb/k6FT4c7y2e0ip yX3MDyItJLrw+3cxSgANgq6zXJnNOzpAatG5xozwNmgrkIA7QPz0jKCKXw8iPoXJ8JKw UWQ1kQLsyuIWscuNTMqWigEi8QNBn12IYgIZsa2VKgrUlWMtwxHBbxJZvoTiQsKOtPOJ S+/g== X-Gm-Message-State: AOAM530X+/sWAA2zmaI1vEd/ckT/gYGMPezfEp2Vg8GdbY3DmF29ykkI 7V+1rKyYxTC+iS4/HcFlVCJ3sA== X-Received: by 2002:a17:90b:196:: with SMTP id t22mr6432467pjs.13.1596237497321; Fri, 31 Jul 2020 16:18:17 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l16sm10621043pff.167.2020.07.31.16.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 16:18:14 -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 26/36] arm/boot: Handle all sections explicitly Date: Fri, 31 Jul 2020 16:08:10 -0700 Message-Id: <20200731230820.1742553-27-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 warning on orphan sections, use common macros for debug sections, discards, and text stubs. Add discards for unwanted .note, and .rel sections. Signed-off-by: Kees Cook --- arch/arm/boot/compressed/vmlinux.lds.S | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S index 09ac33f52814..b914be3a207b 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.S +++ b/arch/arm/boot/compressed/vmlinux.lds.S @@ -2,6 +2,7 @@ /* * Copyright (C) 2000 Russell King */ +#include #ifdef CONFIG_CPU_ENDIAN_BE8 #define ZIMAGE_MAGIC(x) ( (((x) >> 24) & 0x000000ff) | \ @@ -17,8 +18,11 @@ ENTRY(_start) SECTIONS { /DISCARD/ : { + COMMON_DISCARDS *(.ARM.exidx*) *(.ARM.extab*) + *(.note.*) + *(.rel.*) /* * Discard any r/w data - this produces a link error if we have any, * which is required for PIC decompression. Local data generates @@ -36,9 +40,7 @@ SECTIONS *(.start) *(.text) *(.text.*) - *(.gnu.warning) - *(.glue_7t) - *(.glue_7) + ARM_STUBS_TEXT } .table : ALIGN(4) { _table_start = .; @@ -128,12 +130,10 @@ SECTIONS PROVIDE(__pecoff_data_size = ALIGN(512) - ADDR(.data)); PROVIDE(__pecoff_end = ALIGN(512)); - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } + STABS_DEBUG + DWARF_DEBUG + ARM_DETAILS + + ARM_ASSERTS } ASSERT(_edata_real == _edata, "error: zImage file size is incorrect"); -- 2.25.1