From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 446782D8376 for ; Thu, 23 Jul 2026 06:33:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784788384; cv=none; b=l4AmZEY2sEw4uKtLhU+1zsjVL847XfGGAbjk5bqkFIUcpitN7tmbUl92e8oHzRueTdSY89W9IKOgm/hGmxhO2hgd02+e0gkp2J6IO2CRp7G8ZRC01iAyIe5uBFtP2LsFxzukvaQfLpx9pGQJOCuTyFzomjA+rE7bHwvH5s1/dpg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784788384; c=relaxed/simple; bh=tzBPm0P8FtJhS6bipwEKUyI5d3W0ud1o43rAY1ZBYFU=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=O9POl5TDwhQD/KNalGs3h6FV9tq+WHAqL8vwH3gWevVgHnK2kvRu8deN+DJXHTB8rIdBIH7s6O8+SUerKhC9DfViZ5RiZCCEUOfMHUjvVVIRIShOXBtM6So6SQck2wpJpnEQZmiw9/b0U1jMpuhTAYDChCw1t6/xLVfQUvfFQcE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fhwXUBIN; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fhwXUBIN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4ACA1F00A3D for ; Thu, 23 Jul 2026 06:33:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784788382; bh=LOUI7zOM4fXhet323bIMOQ5HL7eLMArXAK7yAqcwUlA=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=fhwXUBINR0w9ruknQf2v8oGPZupXqtDC46cfV2HObwcPG/tpy7SSCjQpgPoHpzDJJ 1tOousWzbml4tJ87N7ckfxYqHApQ6jhlbHbBEJoEMJSXN56eJpZlQQnuDaVQscr46k 4Tv+IO86kXbCDXaZNYj48HJjVV8/R9VDDZ831TbMYMxu1Jp+1UbYKbNMgKQo8JUs+2 8Sm0+hTF/yRWcAOrNfwbx37G7M13ReP5zVINzMd5UaADxEDYSx470N/DoeNL/rpT2W AXBsYDlKQ3428LVil3PK4xfwKQwDuP9tS7hP2e42uFEQCThlI4fYoLCbFYWtlNvcqR PbCVTW73hUbTA== Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfauth.phl.internal (Postfix) with ESMTP id BADC8F4006D; Thu, 23 Jul 2026 02:33:01 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-01.internal (MEProxy); Thu, 23 Jul 2026 02:33:01 -0400 X-ME-Sender: X-ME-Proxy-Cause: dmFkZTGzxgQsIghbX4M2UiidHY+72dk/CGh0YVHz53jt4+zt1NX7kzEUb4Aw5GxxF7/Npk ozbdVedTKeGdpjTBkhQPKwd7ekFbtpY00JA23DBoHvr5PKD0WbqRyX/C70qV9OVfsV8mTn z8zE5mTJKav3Wv/F8aqYAIBeAUXcHKW2qzt0odnva3OMU0ODWvZWJ2iKnjXz0r9nju379x rk2Z8b7xUXfruCPvfDAlqij5Myz97Vk0xvpjp0krgFphl9nQ7XptPla8MBmKx0VL2OPVjM biDuTnJvm3eI8+6yYWDD4WGsnZzNnkhR1OmvZToPa5+JwkPTXDPIh9DejC3OQDaGJWU0IS 6iZU6nASxn+JEorLOcwdGi4yld8kQ6t+eQkrfNL5mUO9Ma7+d3j4bL2f29do675L9nSJjw YFbNYclFTlEfWG0HS60z21BU+fP8JSh04ZdI71x7lMIElNI9GLwWJ69ADkbb37vpAyzpXv f0CTyiDZ3S8R8+YocXdqeGpDekzJ7yLQQUBuKkfSGKby1pBRh4S6ls5Go9Iav0zwaVIKZn e4njhoryRAg+i6uAICW1sLAPHq9XLWRscNNDY5cfBaCB3V3qaKDckYHYSiLIRdXzg9Elgo gbvt/ndcsm+ZLE7FoqJy5hrCWoxwReubEtahNQk0xwrCB5+qd7U3r4fsR4zQ X-ME-Proxy: Feedback-ID: ice86485a:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 87763182007E; Thu, 23 Jul 2026 02:33:01 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Thu, 23 Jul 2026 08:32:40 +0200 From: "Ard Biesheuvel" To: "Nathan Chancellor" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , x86@kernel.org Cc: "Nick Desaulniers" , "Bill Wendling" , "Justin Stitt" , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, stable@vger.kernel.org Message-Id: <592164b0-9a0b-40f7-84ed-26705dca8408@app.fastmail.com> In-Reply-To: <20260722-x86-boot-compressed-disable-jt-clang-v2-1-7373d38482fb@kernel.org> References: <20260722-x86-boot-compressed-disable-jt-clang-v2-1-7373d38482fb@kernel.org> Subject: Re: [PATCH v2] x86/boot/compressed: Disable jump tables Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 23 Jul 2026, at 02:09, Nathan Chancellor wrote: > After a recent upstream LLVM change to start generating jump and lookup > tables in switch statements in more instances [1], linking the > compressed x86 boot image when CONFIG_KERNEL_ZSTD is enabled fails with: > > ld.lld: error: Unexpected run-time relocations (.rela) detected! > > Dumping the relocations in misc.o, which is the only file influenced by > CONFIG_KERNEL_ZSTD in the decompressor, shows dynamic relocations to > some string constants, which correspond to the string literals in the > switch statement in handle_zstd_error(): > > Relocation section '.rela.data.rel.ro' at offset 0x277b0 contains 31 > entries: > Offset Info Type Symbol's > Value Symbol's Name + Addend > 0000000000000000 0000006600000001 R_X86_64_64 > 0000000000000000 .rodata.str1.1 + 73a > 0000000000000008 0000006600000001 R_X86_64_64 > 0000000000000000 .rodata.str1.1 + 78e > 0000000000000010 0000006600000001 R_X86_64_64 > 0000000000000000 .rodata.str1.1 + 78e > 0000000000000018 0000006600000001 R_X86_64_64 > 0000000000000000 .rodata.str1.1 + 78e > ... > > This optimization is problematic for the decompressor environment, as it > is built as -fPIE without any explicit absolute references (as described > at the top of misc.c) while not applying any dynamic relocations, hence > the linker assertion. To opt out of this optimization, which is of > little value in this special early boot code, and to mirror the other > x86 startup code in arch/x86/boot/startup, disable jump tables in the > decompressor. > > Cc: stable@vger.kernel.org > Closes: https://github.com/ClangBuiltLinux/linux/issues/2165 > Link: > https://github.com/llvm/llvm-project/commit/fa02a6ed66b1700c996b49c96c6bc0eb014c9518 > [1] > Signed-off-by: Nathan Chancellor Acked-by: Ard Biesheuvel