-
Notifications
You must be signed in to change notification settings - Fork 14
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
ld.lld: error: drivers/gpu/drm/amd/amdgpu/amdgpu.lto.o: SHT_SYMTAB_SHNDX has 79046 entries, but the symbol table associated has 79048 #1388
Comments
This may be an issue in ELF object writer. I cannot reproduce:
Last few lines of output:
|
@MaskRay sorry, I should have specified that linux-next is needed to see this failure. |
I think I can reproduce The problem is that # of entries in .symtab (0x1d24e8/0x18 = 79583) != # of entries in .symtab_shndx (0x04db78/0x04 = 79582).
|
@samitolvanen doesn't the LTO patch set modify Kbuild to run objtool on the final vmlinux image? I guess if the AMDGPU driver is being built as a module, then objtool has to run on it at some point? Perhaps we could dump amdgpu.lto.o before and after objtool is run on it? |
Yes, we run objtool for the |
$ git diff HEAD
diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal
index 5e9b8057fb24..b10239c8a50b 100644
--- a/scripts/Makefile.modfinal
+++ b/scripts/Makefile.modfinal
@@ -40,6 +40,7 @@ prelink-ext := .lto
ifdef CONFIG_STACK_VALIDATION
cmd_ld_ko_o += \
+ cp $(@:.ko=$(prelink-ext).o) $(@:.ko=$(prelink-ext).o).tmp; \
$(objtree)/tools/objtool/objtool $(objtool_args) \
$(@:.ko=$(prelink-ext).o);
|
thanks for the number @nathanchance . Using @MaskRay 's math on entity size, we have amdgpu.lto.o.tmp: amdgpu.lto.o so indeed, it looks like objtool is adding 1 entity to .symtab, but not .symtab_shndx. Can we find what symbol that is? @nathanchance if you still have those two object files, I think something like: $ comm -1 -3 <$(llvm-readelf -s amdgpu.lto.o.tmp | rev | cut -d ' ' -f 1 | rev) <$(llvm-readelf -s amdgpu.lto.o | rev | cut -d ' ' -f 1 | rev) I think should print the one difference. Then we can see what's special about that symbol. |
That does not seem to work... here is the direct output of that command. Here is the full output of |
post-objtool contains a bunch of warnings from llvm-readelf in the form:
|
|
Related to #1384 (comment)? |
upstream discussion: https://lore.kernel.org/lkml/20210604205018.2238778-1-ndesaulniers@google.com/, looks like there's another public report on that patch as well. |
reverting f66c05d and 9bc0bb5 does resolve the issue for me. Peter has a diff https://lore.kernel.org/lkml/YL3q1qFO9QIRL%2FBA@hirez.programming.kicks-ass.net/ that I'm going to test next. |
The diff resolves the issue for me. |
Merged into mainline: https://git.kernel.org/linus/584fd3b31889852d0d6f3dd1e3d8e9619b660d2c |
As pointed out by CI: https://github.com/ClangBuiltLinux/continuous-integration2/runs/2718382554?check_suite_focus=true
This only happens when
CONFIG_PGO_CLANG
is enabled in addition toCONFIG_LTO_CLANG_THIN=y
:I bisected it down to llvm/llvm-project@b426b45 in LLVM.
cc @MaskRay
The text was updated successfully, but these errors were encountered: