Everything before the word "version" is the tool, and everything after
the word "version" is the version.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
This patch seems to break llvm-dwarfdump, used by emscripten with -g, so I will need to make further changes and probably add new tests.
Actually, it turns out that this is a linker bug. The linker does not know about the producers section yet, so the section ends up being placed before the name section, which makes the resulting binary invalid as far as LLVM is concerned. The fix is to implement proper producers section support in lld. Coming soon.
- Where do you actually put the contents into the binary producer section? YAML result does not show anything.
- Does object file reader support come later as a separate patch?
Why would linker have to know about custom section to make this patch work? We didn't run any linker tests in this patch, did we?
Nice!
We could teach ObjectYAML to understand the contents but I don't think that is necessary for this change.
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp | ||
---|---|---|
154 ↗ | (On Diff #181878) | What if version is not part of the ident? Is that legal? |
See WebAssemblyAsmPrinter.cpp
It's more like the linker is broken in the presence of producers sections, but we didn't know until now because we never had producers sections.
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp | ||
---|---|---|
154 ↗ | (On Diff #181878) | In that case the entire llvm.ident string will be taken as the tool and the version string will be empty. |
As a follow-on, I guess we could get ambitious and add the "language" field as well. I think the only way to do that would be to sniff the language field of the DICompileUnit metadata node (it would of course only exist if there's debug info, but doing anything else seems a bit crazytown).
lib/ObjectYAML/WasmYAML.cpp | ||
---|---|---|
79 ↗ | (On Diff #182145) | Shouldn't these all be optional? |
include/llvm/Object/Wasm.h | ||
---|---|---|
160 ↗ | (On Diff #182145) | Could we keep this interface simpler by putting these in a struct and have "getProducerInfo()" (see DylinkInfo). Otherwise lgtm |