From patchwork Sun Jan 10 11:56:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 360421 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 9DA8DC433E9 for ; Sun, 10 Jan 2021 11:56:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 745DB2395A for ; Sun, 10 Jan 2021 11:56:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbhAJL44 (ORCPT ); Sun, 10 Jan 2021 06:56:56 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:43907 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbhAJL4z (ORCPT ); Sun, 10 Jan 2021 06:56:55 -0500 Date: Sun, 10 Jan 2021 11:56:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610279773; bh=MxtmeMzoZosf2A+5OO/KqkqqfNrpxRLfY3mE8BM76lQ=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=JZj3U2JaMwR6aIb+WJNixdldVJL+Sv39Cg7zlScN1lcrDdhgLwr1j1U2izIIllaGq myziSQIz+n/t3F5fE6BhvLoGmdhdklFvf5QllTupqf//cw1D2EQcktUtFaKc5tsVe8 zr4KO+0q0Ao9RTUUqJ3YPsNu6klprCJxSsxyTIXPInaXkeuXpSH+21g4GOSEH17170 M2H3ax30J9U4jtk2/+bfVHbS8uA1Hl1M80fkLdmMv6fXgdnB/k1l9eml8EI8fwNZvM J+Gi5qzKU6R2CwysDgqu4EmsC7Qrb89FW7D+YElgvAqR6F4N9jky+JQ+Z5450u0xjR Movfwmvgv1y+A== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Huacai Chen , Pei Huang , Kees Cook , Alexander Lobakin , Fangrui Song , Jiaxun Yang , Ralf Baechle , Corey Minyard , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org, clang-built-linux@googlegroups.com Reply-To: Alexander Lobakin Subject: [PATCH v5 mips-next 1/9] MIPS: vmlinux.lds.S: add missing PAGE_ALIGNED_DATA() section Message-ID: <20210110115546.30970-1-alobakin@pm.me> In-Reply-To: <20210110115245.30762-1-alobakin@pm.me> References: <20210110115245.30762-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org MIPS uses its own declaration of rwdata, and thus it should be kept in sync with the asm-generic one. Currently PAGE_ALIGNED_DATA() is missing from the linker script, which emits the following ld warnings: mips-alpine-linux-musl-ld: warning: orphan section `.data..page_aligned' from `arch/mips/kernel/vdso.o' being placed in section `.data..page_aligned' mips-alpine-linux-musl-ld: warning: orphan section `.data..page_aligned' from `arch/mips/vdso/vdso-image.o' being placed in section `.data..page_aligned' Add the necessary declaration, so the mentioned structures will be placed in vmlinux as intended: ffffffff80630580 D __end_once ffffffff80630580 D __start___dyndbg ffffffff80630580 D __start_once ffffffff80630580 D __stop___dyndbg ffffffff80634000 d mips_vdso_data ffffffff80638000 d vdso_data ffffffff80638580 D _gp ffffffff8063c000 T __init_begin ffffffff8063c000 D _edata ffffffff8063c000 T _sinittext -> ffffffff805a4000 D __end_init_task ffffffff805a4000 D __nosave_begin ffffffff805a4000 D __nosave_end ffffffff805a4000 d mips_vdso_data ffffffff805a8000 d vdso_data ffffffff805ac000 D mmlist_lock ffffffff805ac080 D tasklist_lock Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO") Cc: stable@vger.kernel.org # 4.4+ Signed-off-by: Alexander Lobakin Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Reviewed-by: Nathan Chancellor --- arch/mips/kernel/vmlinux.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 5e97e9d02f98..83e27a181206 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -90,6 +90,7 @@ SECTIONS INIT_TASK_DATA(THREAD_SIZE) NOSAVE_DATA + PAGE_ALIGNED_DATA(PAGE_SIZE) CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) DATA_DATA From patchwork Sun Jan 10 11:56:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 361133 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS 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 31841C433E0 for ; Sun, 10 Jan 2021 11:57:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 044F82395A for ; Sun, 10 Jan 2021 11:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726618AbhAJL5C (ORCPT ); Sun, 10 Jan 2021 06:57:02 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:37941 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726608AbhAJL5C (ORCPT ); Sun, 10 Jan 2021 06:57:02 -0500 Date: Sun, 10 Jan 2021 11:56:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610279780; bh=e3Fx1xMuOcodd9nkft6VXE99Jq/7Rxy9CCIA9/ZKpTI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=jaBr7GOjsRY8ora1Ne+lK75KOkB1QTdD3G2VKgTQUzreZm6mRjkkoAiYSSSCarNsj Yg3hZgqmPn3TUctk956YIgMEUoaAnQ/NBpofBjSgSR0chTny6RcL/DT8rmCeJGdtCa Gej3Rbk+1ziZ3oIejDY807ocMKC+EeJwDpI9cJXxEBI8EVVb4UlezbUXxWP3QPexie MmgjVwyMbWKp7LvZysDmIBCIiKxWudE+NJc2WRi0jgrsbulghpynJBkj56AllUNbXT U2Sn3zUkR+YUUJJgyX6bY2y5/yMGcwOul/4J7E6ZljwLQZDvOX5FNfeDatpPrBs3kc 157NhWME+OBUQ== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Huacai Chen , Pei Huang , Kees Cook , Alexander Lobakin , Fangrui Song , Jiaxun Yang , Ralf Baechle , Corey Minyard , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org, clang-built-linux@googlegroups.com Reply-To: Alexander Lobakin Subject: [PATCH v5 mips-next 2/9] MIPS: CPS: don't create redundant .text.cps-vec section Message-ID: <20210110115546.30970-2-alobakin@pm.me> In-Reply-To: <20210110115546.30970-1-alobakin@pm.me> References: <20210110115245.30762-1-alobakin@pm.me> <20210110115546.30970-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org A number of symbols from arch/mips/kernel/cps-vec.S is explicitly placed into '.text.cps-vec' section. There are no direct references to this section, so there's no need to form it. '.balign 0x1000' directive will work anyway. Moreover, this section was being placed in vmlinux differently depending on CONFIG_LD_DEAD_CODE_DATA_ELIMINATION: - with this option enabled, '.text.cps-vec' was being caught by '.text.[0-9a-zA-Z_]*' from include/asm-generic/vmlinux.lds.h; - without this option, '.text.cps-vec' was being caught by discouraging '.text.*' from arch/mips/kernel/vmlinux.lds.S. '.text.*' should not be used in vmlinux linker scripts at all as it silently catches any orphan text sections. So, remove both '.section .text.cps-vec' and '.text.*' from cps-vec.S and vmlinux.lds.S respectively. As said, this does not affect related functions alignment: 80116000 T mips_cps_core_entry 80116028 t not_nmi 80116200 T excep_tlbfill 80116280 T excep_xtlbfill 80116300 T excep_cache 80116380 T excep_genex 80116400 T excep_intex 80116480 T excep_ejtag 80116490 T mips_cps_core_init Signed-off-by: Alexander Lobakin --- arch/mips/kernel/cps-vec.S | 1 - arch/mips/kernel/vmlinux.lds.S | 1 - 2 files changed, 2 deletions(-) diff --git a/arch/mips/kernel/cps-vec.S b/arch/mips/kernel/cps-vec.S index 4db7ff055c9f..975343240148 100644 --- a/arch/mips/kernel/cps-vec.S +++ b/arch/mips/kernel/cps-vec.S @@ -91,7 +91,6 @@ .set pop .endm -.section .text.cps-vec .balign 0x1000 LEAF(mips_cps_core_entry) diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 83e27a181206..ae1d0b4bdd60 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -66,7 +66,6 @@ SECTIONS KPROBES_TEXT IRQENTRY_TEXT SOFTIRQENTRY_TEXT - *(.text.*) *(.fixup) *(.gnu.warning) } :text = 0 From patchwork Sun Jan 10 11:56:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 360420 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 D8828C4332E for ; Sun, 10 Jan 2021 11:57:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7395238E5 for ; Sun, 10 Jan 2021 11:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726663AbhAJL5K (ORCPT ); Sun, 10 Jan 2021 06:57:10 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:50432 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726655AbhAJL5K (ORCPT ); Sun, 10 Jan 2021 06:57:10 -0500 Date: Sun, 10 Jan 2021 11:56:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610279787; bh=z4p3GtI1grxbS9iYRUU8FxMU4I/9YCWsZkDii++EkHY=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=kXksgyJ2ZKnkOB56k/OUlWAYbFEoy4qCZSRRM1QCOSsoJRz/wN/f5197IAyqeLjXc vLyb84amAp9xJQbLkjaOW6bO9+xBinyP0z7mdCuFnsLUEDxyTSVAdNDf3YSeTy/j+T R+e3aG2BGgb4V0StoGGkcZXJgaUDxNuwvKRutZHUijsPJL4zcnWsWvOK7IgDNBitZ/ n0u1DjFtuYJIWqtYXZaANOVkHeDQb5+penkn9WIRCa3Y0/GEh0UJVvzxyUE2dmbfU7 ffc0bS5IU+Z4Jq80t84BDCiUCJXyZ/2KRO6A/NHDYRqQS0WVM9NARCVyAy1zwzPazn qsE28JKCwcStA== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Huacai Chen , Pei Huang , Kees Cook , Alexander Lobakin , Fangrui Song , Jiaxun Yang , Ralf Baechle , Corey Minyard , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org, clang-built-linux@googlegroups.com Reply-To: Alexander Lobakin Subject: [PATCH v5 mips-next 3/9] MIPS: vmlinux.lds.S: add ".gnu.attributes" to DISCARDS Message-ID: <20210110115546.30970-3-alobakin@pm.me> In-Reply-To: <20210110115546.30970-1-alobakin@pm.me> References: <20210110115245.30762-1-alobakin@pm.me> <20210110115546.30970-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Discard GNU attributes (MIPS FP type, GNU Hash etc.) at link time as kernel doesn't use it at all. Solves a dozen of the following ld warnings (one per every file): mips-alpine-linux-musl-ld: warning: orphan section `.gnu.attributes' from `arch/mips/kernel/head.o' being placed in section `.gnu.attributes' mips-alpine-linux-musl-ld: warning: orphan section `.gnu.attributes' from `init/main.o' being placed in section `.gnu.attributes' Signed-off-by: Alexander Lobakin Reviewed-by: Nathan Chancellor --- arch/mips/kernel/vmlinux.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index ae1d0b4bdd60..09669a8fddec 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -220,6 +220,7 @@ SECTIONS /* ABI crap starts here */ *(.MIPS.abiflags) *(.MIPS.options) + *(.gnu.attributes) *(.options) *(.pdr) *(.reginfo) From patchwork Sun Jan 10 11:56:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 361132 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS 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 EFB2CC43332 for ; Sun, 10 Jan 2021 11:57:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB5AC2396F for ; Sun, 10 Jan 2021 11:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbhAJL5O (ORCPT ); Sun, 10 Jan 2021 06:57:14 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:48240 "EHLO mail-40136.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726685AbhAJL5O (ORCPT ); Sun, 10 Jan 2021 06:57:14 -0500 Date: Sun, 10 Jan 2021 11:56:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610279792; bh=NTGpJ7pXsbGsFYQgxGiOz3p29EZ/v0kLX/q+gBWkQ8E=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=EFriee+mgjrIzBkdETTflo54Fup3O5BQZmijK0J+zZwNqSgiY5ZXSo+6rYMH72p03 w+5YUXEwRODn36pdgvMgCHzqm7efrpXt+knwnJ0/AotK9IgY9q3QYdUbl0brZHUfTP RhWO9aqlZrvDHNQ6Z+jWK7AaiIdtNz/pFwGFPFJkMVQoF5yDeelqwqoRmrv9jbcYl2 SOxCxHurTbFCqkb8Kmrnvi45xBNsXDOUCVnsgr/oi1kOUWG/GsZlkEDNinbmH5O/s/ PUtwYpYw+yPXpwbyDFX/l84nVe4sZ/T49UuAFlGP/UVEh5wIt2T4fmKhtIYgkW5wsG CQjqidf5niw6Q== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Huacai Chen , Pei Huang , Kees Cook , Alexander Lobakin , Fangrui Song , Jiaxun Yang , Ralf Baechle , Corey Minyard , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org, clang-built-linux@googlegroups.com Reply-To: Alexander Lobakin Subject: [PATCH v5 mips-next 4/9] MIPS: properly stop .eh_frame generation Message-ID: <20210110115546.30970-4-alobakin@pm.me> In-Reply-To: <20210110115546.30970-1-alobakin@pm.me> References: <20210110115245.30762-1-alobakin@pm.me> <20210110115546.30970-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 866b6a89c6d1 ("MIPS: Add DWARF unwinding to assembly") added -fno-asynchronous-unwind-tables to KBUILD_CFLAGS to prevent compiler from emitting .eh_frame symbols. However, as MIPS heavily uses CFI, that's not enough. Use the approach taken for x86 (as it also uses CFI) and explicitly put CFI symbols into the .debug_frame section (except for VDSO). This allows us to drop .eh_frame from DISCARDS as it's no longer being generated. Fixes: 866b6a89c6d1 ("MIPS: Add DWARF unwinding to assembly") Suggested-by: Kees Cook Signed-off-by: Alexander Lobakin Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor --- arch/mips/include/asm/asm.h | 18 ++++++++++++++++++ arch/mips/kernel/vmlinux.lds.S | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h index 3682d1a0bb80..ea4b62ece336 100644 --- a/arch/mips/include/asm/asm.h +++ b/arch/mips/include/asm/asm.h @@ -20,10 +20,27 @@ #include #include +#ifndef __VDSO__ +/* + * Emit CFI data in .debug_frame sections, not .eh_frame sections. + * We don't do DWARF unwinding at runtime, so only the offline DWARF + * information is useful to anyone. Note we should change this if we + * ever decide to enable DWARF unwinding at runtime. + */ +#define CFI_SECTIONS .cfi_sections .debug_frame +#else + /* + * For the vDSO, emit both runtime unwind information and debug + * symbols for the .dbg file. + */ +#define CFI_SECTIONS +#endif + /* * LEAF - declare leaf routine */ #define LEAF(symbol) \ + CFI_SECTIONS; \ .globl symbol; \ .align 2; \ .type symbol, @function; \ @@ -36,6 +53,7 @@ symbol: .frame sp, 0, ra; \ * NESTED - declare nested routine entry point */ #define NESTED(symbol, framesize, rpc) \ + CFI_SECTIONS; \ .globl symbol; \ .align 2; \ .type symbol, @function; \ diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 09669a8fddec..10d8f0dcb76b 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -224,6 +224,5 @@ SECTIONS *(.options) *(.pdr) *(.reginfo) - *(.eh_frame) } } From patchwork Sun Jan 10 11:56:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 360419 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 D03F3C433DB for ; Sun, 10 Jan 2021 11:57:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 999962395A for ; Sun, 10 Jan 2021 11:57:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726720AbhAJL5U (ORCPT ); Sun, 10 Jan 2021 06:57:20 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:41412 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726608AbhAJL5U (ORCPT ); Sun, 10 Jan 2021 06:57:20 -0500 Date: Sun, 10 Jan 2021 11:56:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610279798; bh=+ae0nqbyeS3RjrUU35uQTOED4nYRvyGMZstGTOsR/XI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=C2tPyl58XE2zQ0KPOSMylWBWbk0UKeDtNEOseTTtSJLWstFv8cTRa0XqoNaYmusB3 maeMzBWCdVdVsiUork2JsMn2ZMcsA7efIbmqnhb03RW69cIZyYgmkZCpQsnbzPJaVm PRXCMI6pg8ODZalPOq0c4P7qcga3n2/DQ1r9W4fy3wckCj2eZEqjUtprOFDrwl2/Z9 G/OyXLkoD5mKAEhPeyHVmgyH3xLpKX4dlzYmj/yOPD76YEwRLjJsHIIwbBd4daD9Vn YBXACF6CdymNRuD3/ZHPHb/e5GlHQpZEse6i5L0stZyrse8JeqUfGIPP/1bnpbidnH nY+860napd82A== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Huacai Chen , Pei Huang , Kees Cook , Alexander Lobakin , Fangrui Song , Jiaxun Yang , Ralf Baechle , Corey Minyard , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org, clang-built-linux@googlegroups.com Reply-To: Alexander Lobakin Subject: [PATCH v5 mips-next 5/9] MIPS: vmlinux.lds.S: explicitly catch .rel.dyn symbols Message-ID: <20210110115546.30970-5-alobakin@pm.me> In-Reply-To: <20210110115546.30970-1-alobakin@pm.me> References: <20210110115245.30762-1-alobakin@pm.me> <20210110115546.30970-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org According to linker warnings, both GCC and LLVM generate '.rel.dyn' symbols: mips-alpine-linux-musl-ld: warning: orphan section `.rel.dyn' from `init/main.o' being placed in section `.rel.dyn' Link-time assertion shows that this section is sometimes empty, sometimes not, depending on machine bitness and the compiler [0]: LD .tmp_vmlinux.kallsyms1 mips64-linux-gnu-ld: Unexpected run-time relocations (.rel) detected! Just use the ARM64 approach and declare it in vmlinux.lds.S closer to __init_end. [0] https://lore.kernel.org/linux-mips/20210109111259.GA4213@alpha.franken.de Reported-by: Thomas Bogendoerfer Signed-off-by: Alexander Lobakin Reviewed-by: Nathan Chancellor --- arch/mips/kernel/vmlinux.lds.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 10d8f0dcb76b..70bba1ff08da 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -137,6 +137,11 @@ SECTIONS PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT) #endif + .rel.dyn : ALIGN(8) { + *(.rel) + *(.rel*) + } + #ifdef CONFIG_MIPS_ELF_APPENDED_DTB .appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) { *(.appended_dtb) From patchwork Sun Jan 10 11:56:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 360418 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 DB88CC433E6 for ; Sun, 10 Jan 2021 11:58:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F83C2396F for ; Sun, 10 Jan 2021 11:58:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbhAJL5s (ORCPT ); Sun, 10 Jan 2021 06:57:48 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:41644 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbhAJL5o (ORCPT ); Sun, 10 Jan 2021 06:57:44 -0500 Date: Sun, 10 Jan 2021 11:56:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610279803; bh=RlF1lh7iHyBsNtm+h3Fc1S3Q2TDvtrRsAKToRMl4zRY=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=YhwP9l3YFs/Snyz4zF4eru6TnU1fWkw+3mw05LcJzw+A3v/4q+HzkCZmy+g1nV7lm 7HvbK69qKcd/5KCyoCYYbIt1rGvG52946+v7bWKtgW3nuO35q91Nqzmrb5SavkVYl9 uxvveKgPQvxNkNuxjbo9cODYeRG3vPkqqf+jqScRAM4XRf2y0Aaac0PZgebeBHC57r ywACjMxtw2/JlIfjWxqyizqN/xg6706DNTKmLkOfUwBnMlhun7Ex78fp63/yETFmWv QjfKlkH3bcokvSVNsc41/JjLdqPMSlB8f+SpiSxxlfhYJe3BQ0JvGSy6uo/5Ez0stH WsW13QZyflgYg== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Huacai Chen , Pei Huang , Kees Cook , Alexander Lobakin , Fangrui Song , Jiaxun Yang , Ralf Baechle , Corey Minyard , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org, clang-built-linux@googlegroups.com Reply-To: Alexander Lobakin Subject: [PATCH v5 mips-next 6/9] MIPS: vmlinux.lds.S: explicitly declare .got table Message-ID: <20210110115546.30970-6-alobakin@pm.me> In-Reply-To: <20210110115546.30970-1-alobakin@pm.me> References: <20210110115245.30762-1-alobakin@pm.me> <20210110115546.30970-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org LLVM stack generates GOT table when building the kernel: ld.lld: warning: :(.got) is being placed in '.got' According to the debug assertions, it's not zero-sized and thus can't be handled the way it's done for x86. Also use the ARM64 path here and place it at the end of .text section. Reported-by: Nathan Chancellor Signed-off-by: Alexander Lobakin Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor --- arch/mips/kernel/vmlinux.lds.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 70bba1ff08da..c1c345be04ff 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -68,6 +68,8 @@ SECTIONS SOFTIRQENTRY_TEXT *(.fixup) *(.gnu.warning) + . = ALIGN(16); + *(.got) /* Global offset table */ } :text = 0 _etext = .; /* End of text section */ From patchwork Sun Jan 10 11:56:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 360417 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS 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 596ACC4332B for ; Sun, 10 Jan 2021 11:58:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 321112395A for ; Sun, 10 Jan 2021 11:58:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726827AbhAJL5w (ORCPT ); Sun, 10 Jan 2021 06:57:52 -0500 Received: from mail-40133.protonmail.ch ([185.70.40.133]:17066 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726825AbhAJL5w (ORCPT ); Sun, 10 Jan 2021 06:57:52 -0500 Date: Sun, 10 Jan 2021 11:56:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610279810; bh=x8cRNNoQDUio05HqY97IXykwYEnNtBTKUh4spQvRTkU=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=Vn6/a5xZo9524H3sJXKD1skGlwNWJBKpxsaQlelflZWpiRO6mvcpRXbkqWhE1penm ndkAzPHQ6OJZnJMzz1W6177XAau2X1iZiwugVn1rACTV1Typ9lpvgpFAZQ9moC2R5d SoyJ4LnYL/PbTdyrTiw92NsZf8ayY1ZA44dtUgQN9XX6hp+EbnFKmC9kgotXWQ3U3P nxwov3RXk0ZzC8oYRrLAsmhVLmFA+7dPmPQeJCIvf4+jcbtukzYFduFdFK5CX7B6M0 xPyUxcRog1HRkHy3MIgZgnMDgH79NpMZVKdPNMBecY7x9TT6tCZeKTYerByMaaXvu4 7D83kWhj3y2eg== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Huacai Chen , Pei Huang , Kees Cook , Alexander Lobakin , Fangrui Song , Jiaxun Yang , Ralf Baechle , Corey Minyard , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org, clang-built-linux@googlegroups.com, Sami Tolvanen Reply-To: Alexander Lobakin Subject: [PATCH v5 mips-next 7/9] vmlinux.lds.h: catch compound literals into data and BSS Message-ID: <20210110115546.30970-7-alobakin@pm.me> In-Reply-To: <20210110115546.30970-1-alobakin@pm.me> References: <20210110115245.30762-1-alobakin@pm.me> <20210110115546.30970-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org When building kernel with LD_DEAD_CODE_DATA_ELIMINATION, LLVM stack generates separate sections for compound literals, just like in case with enabled LTO [0]: ld.lld: warning: drivers/built-in.a(mtd/nand/spi/gigadevice.o): (.data..compoundliteral.14) is being placed in '.data..compoundliteral.14' ld.lld: warning: drivers/built-in.a(mtd/nand/spi/gigadevice.o): (.data..compoundliteral.15) is being placed in '.data..compoundliteral.15' ld.lld: warning: drivers/built-in.a(mtd/nand/spi/gigadevice.o): (.data..compoundliteral.16) is being placed in '.data..compoundliteral.16' ld.lld: warning: drivers/built-in.a(mtd/nand/spi/gigadevice.o): (.data..compoundliteral.17) is being placed in '.data..compoundliteral.17' [...] Handle this by adding the related sections to generic definitions as suggested by Sami [0]. [0] https://lore.kernel.org/lkml/20201211184633.3213045-3-samitolvanen@google.com Suggested-by: Sami Tolvanen Suggested-by: Kees Cook Signed-off-by: Alexander Lobakin Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor --- include/asm-generic/vmlinux.lds.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index b2b3d81b1535..5f2f5b1db84f 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -95,10 +95,10 @@ */ #ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION #define TEXT_MAIN .text .text.[0-9a-zA-Z_]* -#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..LPBX* +#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral* #define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]* -#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* -#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* +#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L* +#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral* #define SBSS_MAIN .sbss .sbss.[0-9a-zA-Z_]* #else #define TEXT_MAIN .text From patchwork Sun Jan 10 11:56:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 361131 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 B5B0DC433E0 for ; Sun, 10 Jan 2021 11:58:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86FB82395A for ; Sun, 10 Jan 2021 11:58:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726789AbhAJL5o (ORCPT ); Sun, 10 Jan 2021 06:57:44 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:30735 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbhAJL5n (ORCPT ); Sun, 10 Jan 2021 06:57:43 -0500 Date: Sun, 10 Jan 2021 11:56:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610279820; bh=uBfGM5EGQNjpg0d/r+6RHo1eXsl0e/48xvwxFVSmmH4=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=P+8SKV7ni23HcrUcB47hl2iy85MY84jROQWpUkBFOwkQmVk0721gLt8uraxdCn/uE D797LDQHehlcKF/0AWssQ+89Kly7aoog1hMRIKs1ExJpTYDKXyx5d4dGFcXPhsoJE/ p4RyBZqSowzG5yYT3gfT70Ur38y7MUm3DvJlXM26qsBV+/x+uBrLWcg7+9FuS2+zlF MmtEL7Anl8euGs9nb4y2Q06vEmxu65EWAQc4imgMDVMFT51T5QNtL+5qKVog0Wquxy Nd9dVUAe/zBVifVS0L7EQv7/oC4h9uDbVkQkBqunwSmgnhxPhDC1tgPpiGstDO2bL8 2YZPrhxbVSX5Q== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Huacai Chen , Pei Huang , Kees Cook , Alexander Lobakin , Fangrui Song , Jiaxun Yang , Ralf Baechle , Corey Minyard , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org, clang-built-linux@googlegroups.com Reply-To: Alexander Lobakin Subject: [PATCH v5 mips-next 8/9] vmlinux.lds.h: catch UBSAN's "unnamed data" into data Message-ID: <20210110115546.30970-8-alobakin@pm.me> In-Reply-To: <20210110115546.30970-1-alobakin@pm.me> References: <20210110115245.30762-1-alobakin@pm.me> <20210110115546.30970-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org When building kernel with both LD_DEAD_CODE_DATA_ELIMINATION and UBSAN, LLVM stack generates lots of "unnamed data" sections: ld.lld: warning: net/built-in.a(netfilter/utils.o): (.data.$__unnamed_2) is being placed in '.data.$__unnamed_2' ld.lld: warning: net/built-in.a(netfilter/utils.o): (.data.$__unnamed_3) is being placed in '.data.$__unnamed_3' ld.lld: warning: net/built-in.a(netfilter/utils.o): (.data.$__unnamed_4) is being placed in '.data.$__unnamed_4' ld.lld: warning: net/built-in.a(netfilter/utils.o): (.data.$__unnamed_5) is being placed in '.data.$__unnamed_5' [...] Also handle this by adding the related sections to generic definitions. Signed-off-by: Alexander Lobakin Reviewed-by: Nathan Chancellor --- include/asm-generic/vmlinux.lds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 5f2f5b1db84f..cc659e77fcb0 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -95,7 +95,7 @@ */ #ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION #define TEXT_MAIN .text .text.[0-9a-zA-Z_]* -#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral* +#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral* .data.$__unnamed_* #define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]* #define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L* #define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral* From patchwork Sun Jan 10 11:57:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 361130 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS 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 F2276C43381 for ; Sun, 10 Jan 2021 11:58:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C77AF238E5 for ; Sun, 10 Jan 2021 11:58:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbhAJL5s (ORCPT ); Sun, 10 Jan 2021 06:57:48 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:31319 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbhAJL5r (ORCPT ); Sun, 10 Jan 2021 06:57:47 -0500 Date: Sun, 10 Jan 2021 11:57:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610279826; bh=9X9TtaxhK4MsjM77KJSI8oMJqQq5vrXLNYznXkmw+KE=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=VWdf7Pv7GU3OQbBGG8mq7oifuAMWGLdcebsIIG0VJqMxSXYWA6gYp1trUxbhMZ+5u kVyNdxORjLV6pYYeEAt6F0oaCveQfzOzGwU6VCUm5JY6fBBTKCLG5A+vsbVobGdD1M dw0HwQbsYF+S0LX/wNy5iJpN8AdYDgEjD02cs75IDkccGGttqWhlEaSpRa2g44ibS5 8vVFHMj6zFg/wICE8+oFGRAPIIRXwh74CipLniLykFRLxz1VyA398AN4TCfL0eOdbZ o2p6KtspEKAzSMpEB5Kn4e25nYWgS07hV/52/4LIpt5iy+FFGZiuDZJfGy0jrpwtTV 70Ox9sSoqMfSg== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Huacai Chen , Pei Huang , Kees Cook , Alexander Lobakin , Fangrui Song , Jiaxun Yang , Ralf Baechle , Corey Minyard , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, stable@vger.kernel.org, clang-built-linux@googlegroups.com Reply-To: Alexander Lobakin Subject: [PATCH v5 mips-next 9/9] MIPS: select ARCH_WANT_LD_ORPHAN_WARN Message-ID: <20210110115546.30970-9-alobakin@pm.me> In-Reply-To: <20210110115546.30970-1-alobakin@pm.me> References: <20210110115245.30762-1-alobakin@pm.me> <20210110115546.30970-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Now, after that all the sections are explicitly described and declared in vmlinux.lds.S, we can enable ld orphan warnings to prevent from missing any new sections in future. Signed-off-by: Alexander Lobakin Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor --- arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d68df1febd25..d3e64cc0932b 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -18,6 +18,7 @@ config MIPS select ARCH_USE_QUEUED_SPINLOCKS select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU select ARCH_WANT_IPC_PARSE_VERSION + select ARCH_WANT_LD_ORPHAN_WARN select BUILDTIME_TABLE_SORT select CLONE_BACKWARDS select CPU_NO_EFFICIENT_FFS if (TARGET_ISA_REV < 1)