[PATCH] D59373: Make a hack for LTO work only when you are actually doing LTO.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 14 11:15:50 PDT 2019
efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: lld/ELF/Driver.cpp:220
+ if (identify_magic(P.first.getBuffer()) != file_magic::bitcode)
+ return;
+
----------------
ruiu wrote:
> efriedma wrote:
> > "return"? It seems weird to intentionally ignore archive files without a symbol table.
> But that is what other linkers do and is also a natural consequence of how linker works on archive files. When a linker visits an archive file, it reads its symbol table, and pulls out object files that defines symbols that are currently undefined. Therefore, if an archive doesn't contain a symbol table, nothing is pulled out, and the archive is effectively ignored.
I guess that's right; it's effectively the same as the other codepath which calls `make<ArchiveFile>()`. But it looks weird at first glance; maybe add an explicit comment noting that.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59373/new/
https://reviews.llvm.org/D59373
More information about the llvm-commits
mailing list