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
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 29160 Build 29159: arc lint + arc unit
Event Timeline
lld/ELF/Driver.cpp | ||
---|---|---|
220 | "return"? It seems weird to intentionally ignore archive files without a symbol table. |
lld/ELF/Driver.cpp | ||
---|---|---|
220 | 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. |
LGTM
lld/ELF/Driver.cpp | ||
---|---|---|
220 | 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. |
"return"? It seems weird to intentionally ignore archive files without a symbol table.