Index: ELF/Config.h =================================================================== --- ELF/Config.h +++ ELF/Config.h @@ -11,16 +11,26 @@ #define LLD_ELF_CONFIG_H #include "llvm/ADT/StringRef.h" +#include "llvm/Support/ELF.h" #include namespace lld { namespace elf2 { +enum ELFKind { + ELFNoneKind, + ELF32LEKind, + ELF32BEKind, + ELF64LEKind, + ELF64BEKind +}; + struct Configuration { llvm::StringRef DynamicLinker; llvm::StringRef Entry; llvm::StringRef Fini = "_fini"; + llvm::StringRef FirstObjName; llvm::StringRef Init = "_init"; llvm::StringRef OutputFile = "a.out"; llvm::StringRef SoName; @@ -37,6 +47,8 @@ bool Shared; bool Static = false; bool WholeArchive = false; + ELFKind ElfKind = ELFNoneKind; + uint16_t EMachine = llvm::ELF::EM_NONE; }; extern Configuration *Config; Index: ELF/Driver.h =================================================================== --- ELF/Driver.h +++ ELF/Driver.h @@ -38,6 +38,9 @@ void addFile(StringRef Path); private: + template