[llvm] [llvm-dwp] Replace MCStreamer with direct ELF writer for zero-copy output (PR #192112)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 17 11:44:37 PDT 2026
dwblaikie wrote:
@jh7370 I'll leave it to you to make a judgement about what code sharing's worth pushing for here. Given the other duplicates already, I guess my bar that this should be more shared is probably overly optimistic - or perhaps this is where we draw some line and try to pay down some of that tech debt/duplication, or decide it's really not that costly/not a big deal, not sure.
To share with MC I'd imagine some sort of inverted API - where the caller tells the lower level API how much data's in each section (or maybe not even that?) and the API then invokes some callback to write each section (& if the API doesn't specify the size, the lower level API could track how much is written and use that to figure out the sizes/use that to write the section table at the end).
I guess the nice thing about having the size up front would be you could multi-thread it like lld - indeed, sharing with lld would be nice if possible, though I know that's an uphill battle/not everyone's on board with that idea. Maybe sharing with ORC?
https://github.com/llvm/llvm-project/pull/192112
More information about the llvm-commits
mailing list