-
Notifications
You must be signed in to change notification settings - Fork 15
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
CONFIG_DEBUG_INFO_BTF does not work with llvm-objdump + llvm-objcopy #779
Comments
Maybe this should be fixed on LLVM side? Probably the easiest way to fix it is to change |
cc @rupprecht, I thought I did that initially but I forgot. |
https://reviews.llvm.org/D74433 is one possible solution. There are other ways that might make this work, so we'll see which one sticks. |
Also @MaskRay fyi |
I vote for updating all the Please make comments if you agree so: https://reviews.llvm.org/D74433 |
Summary: GNU objdump prints the file format in lowercase, e.g. `elf64-x86-64`. llvm-objdump prints `ELF64-x86-64` right now, even though piping that into llvm-objcopy refuses that as a valid arch to use. As an example of a problem this causes, see: ClangBuiltLinux/linux#779 Reviewers: MaskRay, jhenderson, alexshap Reviewed By: MaskRay Subscribers: tpimh, sbc100, grimar, jvesely, nhaehnle, kerbowa, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D74433
Should be fixed as of 60a8a504f16dbbc5f2a6887ecb668ef4cb834949, lemme know if not. |
x86_64 is fixed (although running into a different issue that I will post here shortly). AArch64 still fails because |
@rupprecht thoughts on aarch64? |
I agree they should be compatible. For ELF it was fortunately just a casing issue, but the aarch64 difference is annoying. The two choices are:
I'm not sure which one I'd prefer, because they each have their pros/cons -- on one hand, we don't need to inherit so much legacy bfd naming. On the other hand, we do want llvm-objdump to produce GNU objdump compatible output. Either way, though, we should have llvm-objdump and llvm-objcopy be on the same page. |
Jordan asked me to finish this:/ https://reviews.llvm.org/D76046 will update ARM and AArch64 to match BFD names. |
…ames Follow-up for D74433 What the function returns are almost standard BFD names, except that "ELF" is in uppercase instead of lowercase. This patch changes "ELF" to "elf" and changes ARM/AArch64 to use their BFD names. MIPS and PPC64 have endianness differences as well, but this patch does not intend to address them. Advantages: * llvm-objdump: the "file format " line matches GNU objdump on ARM/AArch64 objects * "file format " line can be extracted and fed into llvm-objcopy -O literally. (ClangBuiltLinux/linux#779 has such a use case) Affected tools: llvm-readobj, llvm-objdump, llvm-dwarfdump, MCJIT (internal implementation detail, not exposed) Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D76046
https://reviews.llvm.org/D76046 made llvm-objdump's "file format" line match ARM/AArch64/RISCV and big-endian PPC32/PPC64. |
With the commit causing #871 reverted, BTF can be successfully generated for aarch64 with LLVM at llvm/llvm-project@0616e99. |
Summary: GNU objdump prints the file format in lowercase, e.g. `elf64-x86-64`. llvm-objdump prints `ELF64-x86-64` right now, even though piping that into llvm-objcopy refuses that as a valid arch to use. As an example of a problem this causes, see: ClangBuiltLinux/linux#779 Reviewers: MaskRay, jhenderson, alexshap Reviewed By: MaskRay Subscribers: tpimh, sbc100, grimar, jvesely, nhaehnle, kerbowa, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D74433
…ames Follow-up for D74433 What the function returns are almost standard BFD names, except that "ELF" is in uppercase instead of lowercase. This patch changes "ELF" to "elf" and changes ARM/AArch64 to use their BFD names. MIPS and PPC64 have endianness differences as well, but this patch does not intend to address them. Advantages: * llvm-objdump: the "file format " line matches GNU objdump on ARM/AArch64 objects * "file format " line can be extracted and fed into llvm-objcopy -O literally. (ClangBuiltLinux/linux#779 has such a use case) Affected tools: llvm-readobj, llvm-objdump, llvm-dwarfdump, MCJIT (internal implementation detail, not exposed) Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D76046
Summary: GNU objdump prints the file format in lowercase, e.g. `elf64-x86-64`. llvm-objdump prints `ELF64-x86-64` right now, even though piping that into llvm-objcopy refuses that as a valid arch to use. As an example of a problem this causes, see: ClangBuiltLinux/linux#779 Reviewers: MaskRay, jhenderson, alexshap Reviewed By: MaskRay Subscribers: tpimh, sbc100, grimar, jvesely, nhaehnle, kerbowa, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D74433
…ames Follow-up for D74433 What the function returns are almost standard BFD names, except that "ELF" is in uppercase instead of lowercase. This patch changes "ELF" to "elf" and changes ARM/AArch64 to use their BFD names. MIPS and PPC64 have endianness differences as well, but this patch does not intend to address them. Advantages: * llvm-objdump: the "file format " line matches GNU objdump on ARM/AArch64 objects * "file format " line can be extracted and fed into llvm-objcopy -O literally. (ClangBuiltLinux/linux#779 has such a use case) Affected tools: llvm-readobj, llvm-objdump, llvm-dwarfdump, MCJIT (internal implementation detail, not exposed) Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D76046
I came across a patch on the netdev mailing list regarding GNU objcopy and I wanted to make sure that
llvm-obcopy
would not regress. As it turns out,llvm-objcopy
does not work at all on either x86_64 or aarch64 (I have not tested anything else).x86_64 failure (defconfig +
CONFIG_DEBUG_INFO
+CONFIG_DEBUG_INFO_BTF
):AArch64 failure (defconfig +
CONFIG_DEBUG_INFO_BTF
):The relevant snippet of code from
scripts/link-vmlinux.sh
:They are using the output from
${OBJDUMP}
to set the-O
flag on${OBJCOPY}
. With the GNU tools, these appear to be mapped 1:1 but that does not appear to be the case for LLVM.For x86_64:
llvm-objdump
's file format isELF64-x86-64
butllvm-objcopy
expects an-O
value ofelf64-x86-64
.For AArch64 :
llvm-objdump
's file format isELF64-aarch64-little
butllvm-objcopy
expects an-O
value ofelf64-littleaarch64
.I am not sure how to reconcile this.
NOTE: To reproduce this, you will need
pahole 1.13
or newer. I just did this:and just added that build folder to my PATH to avoid actually installing it.
The text was updated successfully, but these errors were encountered: