[PATCH] D45801: COFF: Use (name, output characteristics) as a key when grouping input sections into output sections.

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 19 15:30:29 PDT 2018


smeenai added inline comments.


================
Comment at: lld/COFF/Writer.cpp:458
+    // DATA | R | W.
+    if (Name == ".CRT")
+      OutChars = DATA | R;
----------------
pcc wrote:
> smeenai wrote:
> > If I'm reading this correctly link.exe only has this special case in 32-bit mode, but we're doing it for all architectures?
> > 
> > Also, when you say 32-bit, do you mean x86 specifically, or 32-bit ARM as well?
> I can only reproduce it with `IMAGE_FILE_MACHINE_I386`. Do you think it's worth limiting based on machine?
I don't think it's worth limiting based on machine, but it's worth mentioning in the comment that LLD is just doing the special-case for all architectures. I spent a bit of time hunting around for if this was somehow limited to 32-bit from an enclosing scope, for example (since the comment to me implied that we only wanted the special case on 32-bit as well).


https://reviews.llvm.org/D45801





More information about the llvm-commits mailing list