Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp294368pxu; Thu, 7 Jan 2021 05:22:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8WwR/Ji7i/T1A1fO6NnQW5TnDHnsEGstPSy8rLUbUT+Nk8GzrDUy2k78wlXCXVEpTSHNC X-Received: by 2002:a17:906:4950:: with SMTP id f16mr945007ejt.453.1610025761994; Thu, 07 Jan 2021 05:22:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610025761; cv=none; d=google.com; s=arc-20160816; b=h8DUXSX0gC/F0iAXBCm++d4tFFQI69rxEj982PZ3mlhwdZuHnviXrGnFt2kxZQ1cIy Et8pH/2OmVrNI7A/WUZC1zxcJoWjdA8DjNFHmOpovrmYDO1+i+P4Uehv+5sJ0hVLPvPo LsGuYUu5Q3maK5h0WprppSigZwYmmF1KWk49/KzPbIyi14Fvmq+4o3PsfyUh0wcRnK0w p3h8j8sqoj2MO4Zgch6DPggCpuKZC0f2IlvUWQgLs3D9W5NIyBk0uLkswHnU8vzNIXKA HUvxgTOTqM8CgsyC3gN6Bq0xsDsUQQgWQbC3JyYxyC3cyS7uP2Of9IplDboVifMr60ky Dwrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=1iHiRQzHqAO/hOdIJm7931oVSjvi8g99iSxotTA/NNE=; b=turm7XhoYDkmbClRJaTlQ+PvJehJz+EfbgxMOV3F1edimJz1xViPbQR9YrQqbGhSJ3 dDRqAOsgAt3QEAu5oiH607eBMHg6BWToAZgknVG8ZnjirE0RoD9czXrpeh4358NSZW8M Frk/D8C6h6NQpyXu1DzxQwF2OIj+NaFnG+rul0iHHu+fy0e6F9f5fiIlL8zHS4vCpkNl Ca/SrViEpw/1DvUk8XgtyWzuxZs9hQ4Eh/slCKMfRZjqWo8xAyHbyzcbUtrP21/czuSb 1Iz+Y8ouPFEpw9wj7DxeihFNO7Lxli4ZBqvrGzG7EEykeJdBac59GBZXDbkgI21Lh5t2 qdGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=Awz+ntc9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n27si2140605ejc.673.2021.01.07.05.22.18; Thu, 07 Jan 2021 05:22:41 -0800 (PST) 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=@pm.me header.s=protonmail header.b=Awz+ntc9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728446AbhAGNVZ (ORCPT + 99 others); Thu, 7 Jan 2021 08:21:25 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:11999 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728390AbhAGNVZ (ORCPT ); Thu, 7 Jan 2021 08:21:25 -0500 Date: Thu, 07 Jan 2021 13:20:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610025637; bh=1iHiRQzHqAO/hOdIJm7931oVSjvi8g99iSxotTA/NNE=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=Awz+ntc9XFxB3byalr3Ar0uBftjJ34q+4h01Xb55pnPE3Cb64NIpk3HqGpInQ7lEm f6b/iJ6qEzjkGHR/WVYiIP8MGtzwz2845rJwK73wU8Ca2Z+RDR1feEDja745CtaX13 YL8g99zm6cGpd9uCDzGTF1tR8xxXYSFAi4zGQ5URQZpECQtUr6pbWAQS6qbfg7eoDx eDJ4NEonCsAwafi18yssbLCIDOb6C6nDO/8r9kWQtP/cMPh0/BWIQJWzoocZknZmb8 zV0Qqo5jWC/DQqDm1Mx42/kayzt2kVW1LGADT3FpV0r+XKZngqbmWdTPz7np+oFPXR l9sncFXbotHKg== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Arnd Bergmann , Kees Cook , Nathan Chancellor , Nick Desaulniers , Fangrui Song , Huacai Chen , Pei Huang , Jiaxun Yang , Alexander Lobakin , Sami Tolvanen , Ingo Molnar , 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 v4 mips-next 4/7] MIPS: vmlinux.lds.S: catch bad .rel.dyn at link time Message-ID: <20210107132010.463129-1-alobakin@pm.me> In-Reply-To: <20210107123331.354075-1-alobakin@pm.me> References: <20210107123331.354075-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Catch any symbols placed in .rel.dyn and check for these sections to be zero-sized at link time. Eliminates following ld warning: mips-alpine-linux-musl-ld: warning: orphan section `.rel.dyn' from `init/main.o' being placed in section `.rel.dyn' Adopted from x86/kernel/vmlinux.lds.S. Suggested-by: Fangrui Song Signed-off-by: Alexander Lobakin --- arch/mips/kernel/vmlinux.lds.S | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.= S index 0f4e46ea4458..0f736d60d43e 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -226,4 +226,15 @@ SECTIONS =09=09*(.pdr) =09=09*(.reginfo) =09} + +=09/* +=09 * Sections that should stay zero sized, which is safer to +=09 * explicitly check instead of blindly discarding. +=09 */ + +=09.rel.dyn : { +=09=09*(.rel.*) +=09=09*(.rel_*) +=09} +=09ASSERT(SIZEOF(.rel.dyn) =3D=3D 0, "Unexpected run-time relocations (.re= l) detected!") } --=20 2.30.0