llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.98k stars 11.95k forks source link

[llvm-objdump] Fails to disassemble file when debug content is present #68482

Open jcdutton opened 1 year ago

jcdutton commented 1 year ago

This outputs the disassembly: llvm-objdump -d crc8-nodebug.ko This fails to output a disassembly: llvm-objdump -d crc8-debug.ko

jcdutton commented 1 year ago

crc8-debug.ko.zip crc8-nodebug.ko.zip

Note: I zipped the files as the attachment would not accept .ko files. These are Linux kernel module files from the openwrt project. https://openwrt.org

jcdutton commented 1 year ago

They should both output disassembly. Also note, other tools also have a similar problem: objdump, and aarch64-linux-gnu-objdump

jcdutton commented 1 year ago

It turns out the debug file do not include the .text sections, so objdump is treating them as .bss sections. It turns out the debug files do not include the .text content, so the debug and nodebug file need to be merged in order for objdump to work. It would be nice if objdump had an option to load both files in order to disassemble with line numbers etc.

llvmbot commented 1 year ago

@llvm/issue-subscribers-tools-llvm-objdump

This outputs the disassembly: llvm-objdump -d crc8-nodebug.ko This fails to output a disassembly: llvm-objdump -d crc8-debug.ko