Skip to content

Invalid absolute R_X86_64_64 relocation: L3_START_KERNEL #984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nathanchance opened this issue Apr 10, 2020 · 3 comments
Closed

Invalid absolute R_X86_64_64 relocation: L3_START_KERNEL #984

nathanchance opened this issue Apr 10, 2020 · 3 comments
Labels
[ARCH] x86_64 This bug impacts ARCH=x86_64 [BUG] Untriaged Something isn't working [TOOL] integrated-as The issue is relevant to LLVM integrated assembler

Comments

@nathanchance
Copy link
Member

When building my WSL2 kernel with LLVM_IAS=1, I get the following error when building the compressed kernel:

Invalid absolute R_X86_64_64 relocation: L3_START_KERNEL

If you want to reproduce:

$ git clone https://github.com/nathanchance/WSL2-Linux-Kernel

$ cd WSL2-Linux-Kernel

$ ./build.sh LLVM_IAS=1

This might be related to LTO but I cannot fully tell given that when CONFIG_LTO_CLANG is disabled and I have applied a fix to build without ld period, I cannot finish building:

Cannot find symbol for section 2: .text.
init/initramfs.o: failed
diff --git a/Makefile b/Makefile
index 847cc432adbf..ebbc76452f46 100644
--- a/Makefile
+++ b/Makefile
@@ -1048,7 +1048,7 @@ HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)

 ifdef CONFIG_STACK_VALIDATION
   has_libelf := $(call try-run,\
-               echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0)
+               echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOSTLDFLAGS) $(HOST_LIBELF_LIBS) -,1,0)
   ifeq ($(has_libelf),1)
     objtool_target := tools/objtool FORCE
   else
@nathanchance nathanchance added [BUG] Untriaged Something isn't working [TOOL] integrated-as The issue is relevant to LLVM integrated assembler [ARCH] x86_64 This bug impacts ARCH=x86_64 labels Apr 10, 2020
@nathanchance
Copy link
Member Author

So couple of updates:

  1. Invalid absolute R_X86_64_64 relocation: L3_START_KERNEL appears after commit 542612e0e016 ("seq_read-info-message-about-buggy-next-functions-fix") in -next. No idea why but that is what git bisect told me...

  2. The second error Cannot find symbol for section 2: .text. happens when CONFIG_FUNCTION_TRACER is enabled because this comes from scripts/recordmcount.h. I've split this off into a second issue: 'Cannot find symbol for section 2: .text.' with CONFIG_FUNCTION_TRACER #986

@nathanchance
Copy link
Member Author

More consistent reproducer that does not involve the state of my tree:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

$ cd linux-next

$ curl -LSs https://gist.github.com/nathanchance/e59b045fd55ec67947208a0faff8473f/raw/d7e2de4f2c8815d9fde7d133e15ed8075372434d/gistfile1.txt | git apply -3v

$ curl -LSso arch/x86/configs/x86_64_defconfig https://raw.githubusercontent.com/nathanchance/WSL2-Linux-Kernel/e34017aa13b0ed0ccf01339e4c2589c3a80c1e16/arch/x86/configs/wsl2_defconfig

$ make -j$(nproc) -s LLVM=1 LLVM_IAS=1 O=out/x86_64 distclean defconfig bzImage

@nathanchance
Copy link
Member Author

I have never seen this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ARCH] x86_64 This bug impacts ARCH=x86_64 [BUG] Untriaged Something isn't working [TOOL] integrated-as The issue is relevant to LLVM integrated assembler
Projects
None yet
Development

No branches or pull requests

1 participant