Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14393568pxu; Mon, 4 Jan 2021 23:43:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwUezLCYJClvx+nlC53XBO3b4spJKqXEqSd5MCQEh8KriQvSzKb+ahbk3OQZVKL+Onp6+a X-Received: by 2002:a05:6402:202e:: with SMTP id ay14mr76152461edb.102.1609832629160; Mon, 04 Jan 2021 23:43:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609832629; cv=none; d=google.com; s=arc-20160816; b=OKXwTrp6XWIbAjdkZATljyNc71VahFBcOJHH8Il3hGISbsxT/whGp4FpEEAQ+LZTtz iL7Fh6A3IqS0t0f0WNiYJZS9Oldwc3qkmVOVII8HNtQ4yDpm09hM9fBMZj8fpZEbcSYy oubbU7VizxvhSqYDmAA9NfiGcUadYPYwOhXppBVjshV7J47+llQ7kQYEtCTP5OYDA6me 2Ep9ZQ8349xpK7HvIAKGQ3/82iATYqsn0hs2/czV8wiAu9oNkO6RDHtq/HWJrc4okG5I 8ezPrC99yHfeRMvms5PTzJg6Cpr56ERNfaw84Fdjd6wiiVOwHF+Jn2iJeHndMZdN43Sj hTpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qody2jCEDPoy5bjKSwnXJGXZoxBMsCIrdzCynOCmNlU=; b=zveU8op0a3RA4/+/XqTyi/m5MzIy5IETpW7XoWPnjkGo8lMYrshgVRerBsNDa6WPKK hLawLi5VPzcdpIq/kQkanb3dwfZEru1eT/YKK2SU1UYtT93UNt35VD/wtGSPnGXS1KE+ /rjGfUrVbCl8wSYDGdx9sYdCSnPRfePxkVuUaN39WaClqVOAUK/0ox5XHVyUi7FYj1qm 01xqwSYZj++oLlEtAkrbNF2Tj17XWyFvfPhIfBzHPQYsZ3C/1DXOt3msnA6IbYFm/dHf z7rIHQNPbDTvvjb/lZvVDULAkE4Nc16nVuP82ZS17Z1JD2Cbk+uGqFHVyx7T2JSS7oM2 kP0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oq3fBBKm; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k4si33222711eds.355.2021.01.04.23.43.24; Mon, 04 Jan 2021 23:43:49 -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=@google.com header.s=20161025 header.b=oq3fBBKm; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726908AbhAEHkZ (ORCPT + 99 others); Tue, 5 Jan 2021 02:40:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbhAEHkY (ORCPT ); Tue, 5 Jan 2021 02:40:24 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 233F6C061793 for ; Mon, 4 Jan 2021 23:39:44 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id c22so20710862pgg.13 for ; Mon, 04 Jan 2021 23:39:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qody2jCEDPoy5bjKSwnXJGXZoxBMsCIrdzCynOCmNlU=; b=oq3fBBKmVQVQozpKqPhH/2XZWBNc8+cN4bbYtGX+YXzXx3XwUV+HfKRTT6o4OdTLQl o1onvhoy7w5G9I+sfXuNay4Ez8YF0J7LLMolV111jFMx5pjqLmKSrfN3342dzuBFAQhp 0Zu2Sbk46ruW9o6ePdpnVqeKl544A0mafGKogLlZORZIWDWl1YlZx1OwoE63RBKlboB8 oO74UmcBqWY6+n6sJeNktbPMG+87Q/kSvSGufk0npne/7bvt3F1A0hwVknEyB/TPFk5m Qr8dWAoJKy9b24nXUkde2DGeQSicI8dCG5rBwGWIog9BReUCW/2xjL1fXtKZwfRRwXH0 NbGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qody2jCEDPoy5bjKSwnXJGXZoxBMsCIrdzCynOCmNlU=; b=fzFpTeWsT3QIdK+CDNXujYan24gUUCTMCUmy2VPRggMKtZZWLrQSdHcOsgyZ7MAPUt RDCKBxVrl+xArJ4QnPcLrgLNpksv+6m/GEbaXj4P62Xs8fXPm5wmDhWk8ftFmZL1oeqJ Lfy19JAKMrqB8v88Me9wpRK0j06YeUFTBk3Lbb0kF1+J2TVlnMcRmsMrf7t90Oe+TKfW XSUHJ1Y8auqhvggYFS995KwEGpHNisai/aUWxmZFGeJ8u7qjh4jeY5/0fMcbwJV+Smlq +kwqET8i3io9q/R8Kh9oEOVaqDEljMS4FJJnL53PVANE08CrusdB7ssxx41KBXbib7dI LBMQ== X-Gm-Message-State: AOAM531qYsrxQXybeBsgNy/FM/u01iPrKpL9HpHr7xssZZuLq3ib+IOS 5nrZ3AcNy4N6Vb0n7rLJz5yP04qRnUZgFp+BungqnA== X-Received: by 2002:a62:61c5:0:b029:1a9:5a82:4227 with SMTP id v188-20020a6261c50000b02901a95a824227mr46633461pfb.61.1609832383369; Mon, 04 Jan 2021 23:39:43 -0800 (PST) MIME-Version: 1.0 References: <20210104121729.46981-1-alobakin@pm.me> <20210104122016.47308-1-alobakin@pm.me> <20210104122016.47308-2-alobakin@pm.me> In-Reply-To: <20210104122016.47308-2-alobakin@pm.me> From: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Date: Mon, 4 Jan 2021 23:39:32 -0800 Message-ID: Subject: Re: [PATCH mips-next 2/4] MIPS: vmlinux.lds.S: add ".rel.dyn" to DISCARDS To: Alexander Lobakin Cc: Thomas Bogendoerfer , Kees Cook , Ingo Molnar , Jiaxun Yang , Ralf Baechle , Alex Smith , Markos Chandras , linux-mips , "# 3.4.x" , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 4, 2021 at 4:21 AM Alexander Lobakin wrote: > > GCC somehow manages to place some of the symbols from main.c into > .rel.dyn section: > > mips-alpine-linux-musl-ld: warning: orphan section `.rel.dyn' > from `init/main.o' being placed in section `.rel.dyn' > > I couldn't catch up the exact symbol, but seems like it's harmless > to discard it from the final vmlinux as kernel doesn't use or > support dynamic relocations. > > Misc: sort DISCARDS section entries alphabetically. > > Signed-off-by: Alexander Lobakin > --- > arch/mips/kernel/vmlinux.lds.S | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S > index 83e27a181206..1c3c2e903062 100644 > --- a/arch/mips/kernel/vmlinux.lds.S > +++ b/arch/mips/kernel/vmlinux.lds.S > @@ -221,9 +221,10 @@ SECTIONS > /* ABI crap starts here */ > *(.MIPS.abiflags) > *(.MIPS.options) > + *(.eh_frame) > *(.options) > *(.pdr) > *(.reginfo) > - *(.eh_frame) > + *(.rel.dyn) > } > } > -- > 2.30.0 > > (I don't know why I am on the CC list since I know little about mips... Anyway, I know the LLD linker's behavior in case that was the intention... ) I think it'd be good to know the reason why these dynamic relocations are produced and fix the root cause. arch/x86/kernel/vmlinux.lds.S asserts no dynamic relocation: ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")