cjacek wrote: I ended up implementing preserving data section information across merges and took that into account when sorting chunks in #70722. Those changes allowed simplifying this MR. https://github.com/llvm/llvm-project/pull/69100