After llvm/llvm-project@fa02a6e, I see:
$ printf 'CONFIG_%s\n' KERNEL_GZIP=n KERNEL_ZSTD=y >arch/x86/configs/zstd.config
$ make -skj"$(nproc)" ARCH=x86_64 LLVM=1 mrproper defconfig zstd.config bzImage
ld.lld: error: Unexpected run-time relocations (.rela) detected!
make[5]: *** [arch/x86/boot/compressed/Makefile:116: arch/x86/boot/compressed/vmlinux] Error 1
...
With
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 07e0e64b9a98..f3fae2a904ac 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -43,6 +43,8 @@ KBUILD_CFLAGS += -D__DISABLE_EXPORTS
KBUILD_CFLAGS += $(call cc-option,-Wa$(comma)-mrelax-relocations=no)
KBUILD_CFLAGS += -include $(srctree)/include/linux/hidden.h
+CFLAGS_misc.o += -fno-jump-tables
+
# sev-decode-insn.c indirectly includes inat-table.c which is generated during
# compilation and stored in $(objtree). Add the directory to the includes so
# that the compiler finds it even with out-of-tree builds (make O=/some/path).
I do not any linker script assertion failures but I am not sure if that would be considered a hack. Perhaps there is another way to get rid of these relocations (or find out what symbols are causing these sections to appear?)
After llvm/llvm-project@fa02a6e, I see:
With
I do not any linker script assertion failures but I am not sure if that would be considered a hack. Perhaps there is another way to get rid of these relocations (or find out what symbols are causing these sections to appear?)