How to fixup source paths during objdump disassembly?

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/

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

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. ) will produce many missing file warnings.

Thanks for your help!



As far as I’m aware, there is no equivalent option in llvm-objdump currently unfortunately. We should add it. Could you file a bug against llvm-objdump to that effect?


llvm-symbolizer has --relativenames, which is close. It would only take a bit of plumbing to add that to llvm-objdump.