Concrete patches are always useful to help with a discussion, but there needs to be a clear end use-case in a patch (potentially a separate patch that depends on the change you want to make). Without it, the discussion is going to flounder on the question of “why bother with the turbulence”.
there needs to be a clear end use-case
@dblaikie does the llvm-dwp use case still hold some interest for you? At this point I’ve figured out a way around needing these bits for my original project (for now) but I am still interested in learning and I think in the long term this use case will provide bits that will come in handy down the road.
It’s certainly something that I/someone’ll need to fix sooner or later, so I’m happy if it’s of interest to you & I can help with pointers and such.
I think the big unknown is whether we can keep any of the generality of MC - abstracting over different containers (ELF, MachO, etc) - while addressing the abstraction overhead (buffered section contents, having to manifest the section contents at all in some cases prior to writing, being able to write out data as-needed/in certain orders, etc). I know the current implementation’s been handy - like Wasm folks were able to use it, which probably wouldn’t’ve been true if it were written so lower-level like gold’s dwp is written (with only the thinnest abstraction for writing ELF/section headers but otherwise pretty raw writing of bytes to the file). But maybe that abstraction can’t be kept while removing the buffering/otherconstraints - not sure.