[llvm-dev] How to fixup source paths during objdump disassembly?

Pat Pannuto via llvm-dev llvm-dev at lists.llvm.org
Tue Jun 16 14:12:41 PDT 2020


Hi folks,

As part of our build, the Tock project uses remap-path-prefix [1] to create
a reproducible build. This means that the paths inside of built artifacts
are not full source paths. When we later attempt to produce a listings
file, the source mapping fails. The result is many copies of this recently
merged warning [2]:

     llvm-objdump: warning:
'/Volumes/code/helena-project/tock/target/thumbv7em-none-eabi/release/hail.elf':
failed to find source chips/sam4l/src/eic.rs

It looks like GNU objdump provides a --prefix option to address this exact
problem [3]:

*    --prefix=**prefix*     Specify *prefix* to add to the absolute paths
when used with *-S*.

But I can't find an equivalent mechanism in llvm-objdump.

What's the correct way to point objdump to source files during disassembly?

To reproduce the problem, `make lst` in any of the boards for the
Tock Operating System (e.g.
https://github.com/tock/tock/tree/master/boards/hail ) will produce many
missing file warnings.

Thanks for your help!

-Pat

[1]
https://doc.rust-lang.org/1.24.0/unstable-book/compiler-flags/remap-path-prefix.html
[2] https://reviews.llvm.org/D62462
[3] https://linux.die.net/man/1/objdump
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200616/f7a1df04/attachment.html>


More information about the llvm-dev mailing list