Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp243828pxu; Thu, 7 Jan 2021 03:56:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyC0BtglFd8nZDHmA12rgZsc5f3G/v/IrCDOpP5YSwpJHPxiFuS2T9Npwd65m9oCAXu/1st X-Received: by 2002:a17:907:da7:: with SMTP id go39mr6324948ejc.58.1610020575506; Thu, 07 Jan 2021 03:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610020575; cv=none; d=google.com; s=arc-20160816; b=iD9xERN4tT8HJjdI8YuXfM/+0kxDh5h5zrsCPfQzfeDFqd9Gl58Lgr7//8uhnZupyG i/+98bNZt4J6FOH3SmqwdPswMrUjTFHLuyU/XtObBHeq1Y9OCj/PV0g8bBsNsYpR/wN5 qFMat3omhbnnmIGRqpaeeto2Bk4yeEIFeNl0ZGnvbK9Ui0/cXp3wt27szUs6I03gBmHR qQnVF5RxluuBN1pmyqfTFSfOGii8E879Ay7tZWT2ZdbZpJ+CRNRqdg4QVfbGS4YA+6u5 jeyryFmW32SMfP9TlaEAQSxluhWU4FOHN2S0JfcKDhOYM7mx0QLa8YFwL1MYXC3tLk++ cTRQ== 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=e+k51KeP2UiIE4ClArhUndmY8nwxAkeFhLiJ5KOmIh8v1Xks/41cS9prrtiAadAQ3r lB0xS88xnHFJmPooDUBSHJJzoph06+FEV1Bg/5qnS+cS4wOt+8YXIYsZ6n4MW36S9cWm /OdhQq6aHocSZ9d9RhcoNQ/FMPD+/auCAaA9CZsFUZs3H6Sy21kal/ImOCFwSQiXXOJc +fj2GacbWsxXN4l6TAuIwpPIwRNfZtCj4KZgfRO5XA4tIZZF0Bk4Nq+mgCznT+mLo2JX byl85idB2PaRFKaxJbITtv5xmJhhMc5XRBm+6Gz7m25YhDljwN5SBshXn/+6uKhoZgXx Cehw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=h9iDE6kY; 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 bt28si2147637edb.269.2021.01.07.03.55.52; Thu, 07 Jan 2021 03:56:15 -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=h9iDE6kY; 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 S1728090AbhAGLzJ (ORCPT + 99 others); Thu, 7 Jan 2021 06:55:09 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:49684 "EHLO mail-40136.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727874AbhAGLzI (ORCPT ); Thu, 7 Jan 2021 06:55:08 -0500 Date: Thu, 07 Jan 2021 11:54:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610020448; bh=1iHiRQzHqAO/hOdIJm7931oVSjvi8g99iSxotTA/NNE=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=h9iDE6kYHoQBexkMbRaeK54YzGi6+A5II9aLhoDuUgm9dAgTgIfDEJGYmr1UC2yIZ JREQr544tOE1P32+AuHWzTO5MRYqHkYBz1c9dE0WDWNm608M5Awd90cTG3Cnb/IxGo gYlMIVh2tb3kQMwghxTHGFtxhzqXHh7/vuRXYCTaet0z8uvPzSkJTJBJPTQIuD8DTF e7nnotl5SZ+TKjpCirUVXeE7esPQt874qFPiteLNySMNysyOtATkdySQ4yXZFH4spw CCXyRY/GZIKfSymZrdNz9h0ndUR9p+LZSS9HbBeCmgJ32pPsEUSj8DS50Pm7Odo4vL 7EkzefXyUDKtg== 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 v3 mips-next 4/7] MIPS: vmlinux.lds.S: catch bad .rel.dyn at link time Message-ID: <20210107115329.281266-4-alobakin@pm.me> In-Reply-To: <20210107115329.281266-1-alobakin@pm.me> References: <20210107115120.281008-1-alobakin@pm.me> <20210107115329.281266-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