MSVC does this. The user can override it with their own /merge: flag.
Details
Diff Detail
- Build Status
Buildable 12300 Build 12300: arc lint + arc unit
Event Timeline
Do you think we should merge .idata, .edata, and .didata into .rdata as well? That will be more involved than this.
What are the advantages to the section merging, apart from matching link's ouput? I personally prefer LLD keeping the separate sections, since it's easier to examine them that way.
Saves alignment padding, mostly. All of .xdata, .edata, .idata, and .didata can be dumped by llvm-readobj by starting from the PE headers, so they aren't that hard to read without section headers. The alignment padding is particularly bad when sections have different protections so we have to pad out to 4096 to get to a page boundary, as in .data vs. .didata, which are typically near each other because we sort output sections alphabetically.
This caused EH-related test failures on 32-bit LLD bots: https://ci.chromium.org/buildbot/chromium.clang/CrWinClangLLD/166
64-bit code was fine. I'm reverting and will investigate later.