This can be useful for post-link tools and for testing. Sometimes
it can be useful to produces a regular executable but with relocations
preserved.
Details
Diff Detail
- Repository
- rLLD LLVM Linker
Event Timeline
LGTM
But I wonder what kind of tools need this flag in the wasm ecosystem. As far as I know, in the ELF world, Linux kernel is using this, but that is not an ordinary program.
My motivation is mostly for testing purposes. I want to be able to include reloc information in the output without going for --relocatable .. mostly so objdump can tell me a little more about the output file. If you think thats not a good enough motivation I could reconsider.
Specifically I want to use in https://reviews.llvm.org/D62380.
Once we have better objdump -d support this might not be necessary.
All the existing use cases of the feature is somewhat tricky. But if you already have --relocatable, implementing --emit-relocs is pretty easy as you demonstrated. So, it's up to you, but I'd perhaps just submit this.