This diff paves the way for D102964: [lld-macho] Implement cstring deduplication which adds a new kind of
InputSection.
We previously maintained section ordering implicitly: we created
InputSections as we parsed each file in command-line order, and passed
on this ordering when we created OutputSections and OutputSegments by
iterating over these InputSections. The implicitness of the ordering
made it difficult to refactor the code to e.g. handle a new type of
InputSection. As such, I've codified the ordering explicitly via
inputOrder fields. This also allows us to use sort instead of
stable_sort.
Benchmarking chromium_framework on my 3.2 GHz 16-Core Intel Xeon W:
N Min Max Median Avg Stddev x 20 4.23 4.35 4.27 4.274 0.030157481 + 20 4.24 4.38 4.27 4.2815 0.033759989 No difference proven at 95.0% confidence
This is a dangerous default that is almost always wrong in practice since it makes every section compete with BSS sections (which _must_ be last). See https://bugs.llvm.org/show_bug.cgi?id=50769#c5