We allow an archive file without symbol table as a linker input as a
workaround for a very common error in LTO build. But that logic worked
even for an archive file containing non-bitcode files, which is not
expected. This patch limits that workaround to one that contains only
bitcode files.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lld/ELF/Driver.cpp | ||
---|---|---|
220 ↗ | (On Diff #190668) | "return"? It seems weird to intentionally ignore archive files without a symbol table. |
lld/ELF/Driver.cpp | ||
---|---|---|
220 ↗ | (On Diff #190668) | 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. |
Comment Actions
LGTM
lld/ELF/Driver.cpp | ||
---|---|---|
220 ↗ | (On Diff #190668) | 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. |