[PATCH] D39972: [LLD] [COFF] Support ENTRY and SUBSYSTEM in .drectve sections

David Major via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 12:46:15 PST 2017


dmajor created this revision.
dmajor added a project: lld.

Adds support for "/ENTRY" and "/SUBSYSTEM" linker options in .drectve sections. Some Mozilla binaries were using these directives and MSVC link.exe appears to allow them. No attempt is made to reconcile these with the options on the command line.


https://reviews.llvm.org/D39972

Files:
  COFF/Driver.cpp


Index: COFF/Driver.cpp
===================================================================
--- COFF/Driver.cpp
+++ COFF/Driver.cpp
@@ -245,6 +245,9 @@
       if (Optional<StringRef> Path = findLib(Arg->getValue()))
         enqueuePath(*Path, false);
       break;
+    case OPT_entry:
+      Config->Entry = addUndefined(mangle(Arg->getValue()));
+      break;
     case OPT_export: {
       Export E = parseExport(Arg->getValue());
       if (Config->Machine == I386 && Config->MinGW) {
@@ -272,6 +275,10 @@
     case OPT_section:
       parseSection(Arg->getValue());
       break;
+    case OPT_subsystem:
+      parseSubsystem(Arg->getValue(), &Config->Subsystem,
+                     &Config->MajorOSVersion, &Config->MinorOSVersion);
+      break;
     case OPT_editandcontinue:
     case OPT_fastfail:
     case OPT_guardsym:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39972.122702.patch
Type: text/x-patch
Size: 854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171113/54107d9f/attachment.bin>


More information about the llvm-commits mailing list