Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp612267pxb; Fri, 8 Jan 2021 13:20:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxl8CerHRW74yGJW079+wD/RLWEc9W2vBycNswf5H22ZySSwq3dffIibG7psEfU4FTnYp6W X-Received: by 2002:a17:907:435c:: with SMTP id oc20mr4020060ejb.286.1610140818037; Fri, 08 Jan 2021 13:20:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610140818; cv=none; d=google.com; s=arc-20160816; b=aLoKl5ZHfJ2ndD6d549PUM67kfk1BZKmFJ1YwqZqmShjJ0Wu9w2G74/P8s9B+b8kld 25Umjioe04nHaoJL7wUYyRRcHRV1MA9dlELtjilvfWN9WtpxZkTvs+JeXRW4p38D9R1t tOBMI5J0l9bambNE/DurLEk24BceXmDR4Y+yca1B3efe778YaMqsitiA1+ylhTQHaTWr XKkEMELeTHVqnuukJwJ+0dJAzjE4dcOntahLB88uq/jX9uLCvdkSpPxuZtQ1v+FIYApl AfE58tdB1JGuHuDiFJWsWcpFihyvjNV12p9ln5UsTYamvky6PEkSs5Bmq0hnve0mO4qu ocDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bpkcFsKU0saeY1OcJS3d/0PfwhXjvV9PMm7UfLxWFeQ=; b=kp9Xtxe+rqOVW2K/9x/RM2MCBi43ox+d7evh2U2llNg7L8kjmIQ8JTyLE/q8nVaAJh RqJ6EsUl+SeMB8nZn/tE5c8kwIC5EK5ybXUxnm/ZDw/C+IH6gGIqHDRsN/OD0V/OaUm7 8+GM1Vau2oecs+hW353X+TOziADssh+ae/IzTiZdIP/tJnNnUEAHNgxKLK9PaZjTburN +zktKl4DisNyMbMPG+EorO2U/EA414Q2FnqY+PaPfOY7kCVJDH/X2DSRb3kd3qnEtUi3 mWrE9GI0hbQjGxMI8BC2WYflOKwANpqzNs3VYuh7WUmSNh1Tp20nCWPvK9Qxo9z1t7m8 YlhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pwsyvOR1; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gl19si3791080ejb.476.2021.01.08.13.19.54; Fri, 08 Jan 2021 13:20:18 -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=@gmail.com header.s=20161025 header.b=pwsyvOR1; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729378AbhAHVRq (ORCPT + 99 others); Fri, 8 Jan 2021 16:17:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729212AbhAHVRq (ORCPT ); Fri, 8 Jan 2021 16:17:46 -0500 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F7C1C061574; Fri, 8 Jan 2021 13:17:06 -0800 (PST) Received: by mail-qk1-x72d.google.com with SMTP id z11so9772946qkj.7; Fri, 08 Jan 2021 13:17:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bpkcFsKU0saeY1OcJS3d/0PfwhXjvV9PMm7UfLxWFeQ=; b=pwsyvOR1TDfewdtw5elKW7YRv2TBTKC30qhCnDf/W5MlkC2eDpWCWDIw6U5sCoEuCD SS2vyOf1OaRIdw8hZ4WzAtAVBd/q4016QQ8hOTJvSc2Xe6UMHh+qZU18Gpuz7DZNbvX1 c/rCRzsN+WBoNhZ4/HG6M4OF2mIf2hnDfPsGLDHIIViQjM7vLgIrIGB4HfRvj1dAlZQu 09yvaV+ow7ZJtgNDKTRIXs7IX4wtBGVEEiLgT/Qh0zttGXqY4R6oT7upkg6s4VNxxYUF QJKji5AEQwg9H47OSL17iLQOJeQ6YsgEhWu6xQJt4qvzrYFY/slHtyehRqh49UdE4cb5 lmnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bpkcFsKU0saeY1OcJS3d/0PfwhXjvV9PMm7UfLxWFeQ=; b=cey86I0eVgXw3u8DmTfpjUxHNT++b9Sc0F6jigEeULTbvKLOAkblKEh/INias6bh5B Nh9535KLu7WumzTqJrD+4Mv75vXDjgljU9xy5hZf+/9y04F3f9GV/PP1c6u+V5MZoKMF XPGNKXT37xRDpyDKXlIfLGYlSH4Rik2+bJ0EgmEZz5PONCXLndyehvKenUGhSidosunm gei6ZY+/xyoO8SqqzUVRCtnVCuROz2M6XSfl+MzAMtmM/NJx0YDtitUhTrQDdeY9dMMZ P1kQxHbSm6MWmwfuLgz3GKs0yGmSxmz3UstlCWBLzMzKq2vgmdO+LPiJloaKv2Z3Nn42 Zorg== X-Gm-Message-State: AOAM533pgRH2TkIpf/BLoa6wv9YhtlA2dP4kkgXe7J42YY6pQacpKMtn 1SssNL5NKd8M/fipUR7N9SA= X-Received: by 2002:a37:c89:: with SMTP id 131mr6046009qkm.468.1610140625412; Fri, 08 Jan 2021 13:17:05 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id q23sm4970567qtp.39.2021.01.08.13.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 13:17:04 -0800 (PST) Date: Fri, 8 Jan 2021 14:17:03 -0700 From: Nathan Chancellor To: Alexander Lobakin Cc: Thomas Bogendoerfer , Arnd Bergmann , Kees Cook , Nick Desaulniers , Fangrui Song , Huacai Chen , Pei Huang , Jiaxun Yang , 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 Subject: Re: [PATCH v4 mips-next 4/7] MIPS: vmlinux.lds.S: catch bad .rel.dyn at link time Message-ID: <20210108211703.GD2547542@ubuntu-m3-large-x86> References: <20210107123331.354075-1-alobakin@pm.me> <20210107132010.463129-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210107132010.463129-1-alobakin@pm.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 07, 2021 at 01:20:33PM +0000, Alexander Lobakin wrote: > 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 Reviewed-by: Nathan Chancellor > --- > 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 > *(.pdr) > *(.reginfo) > } > + > + /* > + * Sections that should stay zero sized, which is safer to > + * explicitly check instead of blindly discarding. > + */ > + > + .rel.dyn : { > + *(.rel.*) > + *(.rel_*) > + } > + ASSERT(SIZEOF(.rel.dyn) == 0, "Unexpected run-time relocations (.rel) detected!") > } > -- > 2.30.0 > >