From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 561F1258CC5; Mon, 21 Apr 2025 06:04:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745215477; cv=none; b=V6Ste/80aYPOKuxiiAX4ZOjsLijDnrVJSooGx5rk3cIns1s3NNejCtKcaPs5JsU58ZyOCydwS+PNk3H43uzZVHWEzvV4gYNuGXLgQ4mup4QPgVHdjvyEbC0x+v3dY1ljp5luURMVUFB5P7unhNd0z5bRtZJpFZTGGxkSY76I4Tw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745215477; c=relaxed/simple; bh=n43iKQ1gQcZ6UYLU7kJ37Nyk9QEUGWo8UtaRhUgH5tE=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=XiZtT8S95WOWkJHmhndfNkWcDGal+9rGt5ybFRJFVeZCUMNNx4wdY3sag9Mkj5irVp24jDXzHq3tDf7tbR/qCnv4UbM/4NkE5sLceNJ5XZtyoY2vCK4OzQ7meytyWDq4MpJgom6pW3+8u57tqe2utNpZLIiQZ1i5l4wvZ1qgA3M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr; spf=pass smtp.mailfrom=ghiti.fr; arc=none smtp.client-ip=217.70.183.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id C660B4435C; Mon, 21 Apr 2025 06:04:21 +0000 (UTC) Message-ID: <75e07bb8-e9e2-428f-85d7-5c5b9dc7b1c5@ghiti.fr> Date: Mon, 21 Apr 2025 08:04:21 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] scripts: Do not strip .rela.dyn section Content-Language: en-US To: Alexandre Ghiti , Paul Walmsley , Palmer Dabbelt , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Ard Biesheuvel , Charlie Jenkins , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kbuild@vger.kernel.org References: <20250408072851.90275-1-alexghiti@rivosinc.com> From: Alexandre Ghiti In-Reply-To: <20250408072851.90275-1-alexghiti@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvgedttdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetlhgvgigrnhgurhgvucfihhhithhiuceorghlvgigsehghhhithhirdhfrheqnecuggftrfgrthhtvghrnhephfehgfdvteejiefgvdevkefgudehkeekhefgkedvtdeugedtvefffeejheektdfgnecukfhppedvtddtudemkeeiudemfeefkedvmegvfheltdemudhfheejmegvudgtugemudekugdtmegttddvkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvtddtudemkeeiudemfeefkedvmegvfheltdemudhfheejmegvudgtugemudekugdtmegttddvkedphhgvlhhopeglkffrggeimedvtddtudemkeeiudemfeefkedvmegvfheltdemudhfheejmegvudgtugemudekugdtmegttddvkegnpdhmrghilhhfrhhomheprghlvgigsehghhhithhirdhfrhdpnhgspghrtghpthhtohepuddvpdhrtghpthhtoheprghlvgigghhhihhtihesrhhivhhoshhinhgtrdgtohhmpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepphgrlhhmvghrsegurggssggvlhhtrdgto hhmpdhrtghpthhtohepsghjohhrnhesrhhivhhoshhinhgtrdgtohhmpdhrtghpthhtohepmhgrshgrhhhirhhohieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgrthhhrghnsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehnihgtohhlrghssehfjhgrshhlvgdrvghupdhrtghpthhtoheprghruggssehkvghrnhgvlhdrohhrgh X-GND-Sasl: alex@ghiti.fr Hi Masahiro, On 08/04/2025 09:28, Alexandre Ghiti wrote: > The .rela.dyn section contains runtime relocations and is only emitted > for a relocatable kernel. > > riscv uses this section to relocate the kernel at runtime but that section > is stripped from vmlinux. That prevents kexec to successfully load vmlinux > since it does not contain the relocations info needed. > > Fixes: 559d1e45a16d ("riscv: Use --emit-relocs in order to move .rela.dyn in init") > Tested-by: Björn Töpel > Reviewed-by: Björn Töpel > Acked-by: Ard Biesheuvel > Signed-off-by: Alexandre Ghiti > --- > > Changes in v3: > - Rebase on top of 6.15-rc1 > - Change the fixes tag > > Changes in v2: > - Changelog modification (Ard) > - Remove ARCH_WANTS_RELA_DYN (Ard) > > scripts/Makefile.vmlinux | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux > index b0a6cd5b818c..85d60d986401 100644 > --- a/scripts/Makefile.vmlinux > +++ b/scripts/Makefile.vmlinux > @@ -13,7 +13,7 @@ ifdef CONFIG_ARCH_VMLINUX_NEEDS_RELOCS > vmlinux-final := vmlinux.unstripped > > quiet_cmd_strip_relocs = RSTRIP $@ > - cmd_strip_relocs = $(OBJCOPY) --remove-section='.rel*' $< $@ > + cmd_strip_relocs = $(OBJCOPY) --remove-section='.rel*' --remove-section=!'.rel*.dyn' $< $@ > > vmlinux: $(vmlinux-final) FORCE > $(call if_changed,strip_relocs) Do you think you can merge that in the next rc? If not, I can merge it if you add your AB :) Thanks, Alex