LC -> Cmd?
This can be:
// Remove .... for (Section *Sec : OrderedSections) Sec->Addr -= OrderedSections->Addr;
Does it make sense to remove this in favor of speed?
What do you think of using probably more traditional/clear Obj and Buf names?
Addressed review comments.
LC is the common abbreviation for LoadCommand under llvm-objcopy/MachO.
I don't think it works. This for loop subtracts the original value of the first section's address (OrderedSections->Addr). In the code you suggested, in the first iteration, Sec points to OrderedSections and as a result OrderedSections->Addr becomes 0 in remaining iterations.
I'd like to keep them because O and B are widely used under llvm-objcopy/MachO. That said, Obj and Buf looks better to me. I'll submit another NFC patch to rename them.