[PATCH] D12323: lld: make pe targets use the coff linker

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 20:47:07 PDT 2015


compnerd added a subscriber: compnerd.

================
Comment at: lib/Driver/UniversalDriver.cpp:97
@@ -96,1 +96,3 @@
 
+static bool isPETarget(const llvm::opt::InputArgList &parsedArgs) {
+  llvm::opt::Arg *argMachine = parsedArgs.getLastArg(OPT_m);
----------------
I think we should flip this around, and make this more `getTargetFromEmulation`.  It should return a tuple (pair) for architecture, format for the emulation mode.  So, i386pe -> (COFF,I386), thumb2pe -> (COFF,ARMNT).  This could then be used in the future to extend it for the other GNU emulations.

================
Comment at: lib/Driver/UniversalDriver.cpp:212
@@ +211,3 @@
+  //Override gnu for pe targets to use coff
+  if(isPETarget(parsedArgs)) {
+    coff::link(args);
----------------
Space after if.  Although, this would change with the above to switch off of the format that we converted the emulation to.


http://reviews.llvm.org/D12323





More information about the llvm-commits mailing list