[PECOFF] support additional subsystem identifiers
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 24 Aug 2013 20:14:54 +0000 (20:14 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 24 Aug 2013 20:14:54 +0000 (20:14 +0000)
This completes the subsystem name parsing to support the identifiers that the
Microsoft link.exe linker supports.  "windows" and "console" are left as the
first items as they are the expected common paths.

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
llvm-svn: 189181

lld/lib/Driver/WinLinkDriver.cpp

index 487ab14..315be0b 100644 (file)
@@ -99,6 +99,16 @@ llvm::COFF::WindowsSubsystem stringToWinSubsystem(StringRef str) {
   return llvm::StringSwitch<llvm::COFF::WindowsSubsystem>(str.lower())
       .Case("windows", llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_GUI)
       .Case("console", llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_CUI)
+      .Case("boot_application",
+            llvm::COFF::IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION)
+      .Case("efi_application", llvm::COFF::IMAGE_SUBSYSTEM_EFI_APPLICATION)
+      .Case("efi_boot_service_driver",
+            llvm::COFF::IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER)
+      .Case("efi_rom", llvm::COFF::IMAGE_SUBSYSTEM_EFI_ROM)
+      .Case("efi_runtime_driver",
+            llvm::COFF::IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER)
+      .Case("native", llvm::COFF::IMAGE_SUBSYSTEM_NATIVE)
+      .Case("posix", llvm::COFF::IMAGE_SUBSYSTEM_POSIX_CUI)
       .Default(llvm::COFF::IMAGE_SUBSYSTEM_UNKNOWN);
 }