cargo-binutils icon indicating copy to clipboard operation
cargo-binutils copied to clipboard

--arch-name causing objdump problems

Open moridinga opened this issue 2 years ago • 0 comments

Working on an embedded project, targeting a Cortex-R52, and I've discovered that the fact that the --arch-name argument is passed to the llvm-objdump tool is causing disassembly to fundamentally misbehave (lots of <unknown> in the output as the disassembler won't decode certain opcodes). The executable is built using the armv7r-none-eabihf target triple, with target-cpu=cortex-r52 rustflag. If I run llvm-objdump -d directly against the output binary, the disassembly is perfect. If I run it with the additional --arch-name=arm (which is what the cargo-binutils is adding on when calling cargo objdump), then we see this problem. In other words, cargo-binutil's insistence on adding the --arch-name argument to the tool call is actually breaking it for this target. If this arg really is needed for some architectures, then I would request we make a similar exception for "arm" that we use for "thumb" and stop blindly passing this down to the tool invocation. It is not even clear why objdump is receiving this special treatment, while none of the other tools do.

moridinga avatar Apr 14 '23 13:04 moridinga