diff options
Diffstat (limited to 'lld/lib/Driver/GnuLdDriver.cpp')
-rw-r--r-- | lld/lib/Driver/GnuLdDriver.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lld/lib/Driver/GnuLdDriver.cpp b/lld/lib/Driver/GnuLdDriver.cpp index 0685daa1eb6..b5f20417112 100644 --- a/lld/lib/Driver/GnuLdDriver.cpp +++ b/lld/lib/Driver/GnuLdDriver.cpp @@ -110,6 +110,16 @@ bool GnuLdDriver::linkELF(int argc, const char *argv[], if (!options) return true; + // Register possible input file parsers. + options->registry().addSupportELFObjects(options->mergeCommonStrings(), + options->targetHandler()); + options->registry().addSupportArchives(options->logInputFiles()); + options->registry().addSupportYamlFiles(); + options->registry().addSupportNativeObjects(); + if (options->allowLinkWithDynamicLibraries()) + options->registry().addSupportELFDynamicSharedObjects( + options->useShlibUndefines()); + return link(*options, diagnostics); } @@ -326,6 +336,8 @@ bool GnuLdDriver::parse(int argc, const char *argv[], } resolvedInputPath = resolvedPath->str(); } + // FIXME: Calling getFileMagic() is expensive. It would be better to + // wire up the LdScript parser into the registry. llvm::sys::fs::file_magic magic = llvm::sys::fs::file_magic::unknown; error_code ec = getFileMagic(*ctx, resolvedInputPath, magic); if (ec) { @@ -336,7 +348,6 @@ bool GnuLdDriver::parse(int argc, const char *argv[], if ((!userPath.endswith(".objtxt")) && (magic == llvm::sys::fs::file_magic::unknown)) isELFFileNode = false; - FileNode *inputNode = nullptr; if (isELFFileNode) inputNode = new ELFFileNode(*ctx, userPath, index++, isWholeArchive, |