[PATCH] D63109: lld-link: Reject more than one resource .obj file

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 22 13:24:14 PDT 2019


mstorsjo added a comment.

> link.exe's /wholearchive semantics on the other hand mean that it wouldn't load the resource object files from the .lib file at all. Since this scenario is probably still an unlikely corner case, the difference in behavior here seems fine -- and lld-link might have to change to use link.exe's /wholearchive semantics in the future anyways.

Do you have any pointers on the best way of accomplishing that? That would fix the VLC build issue I'm looking into.

It would be straightforward to pass a flag to `LinkerDriver::addArchiveBuffer` to indicate whether resource object files should be dropped or not, but even at that stage, we don't know what kind of object file it is until we pass it to SymTab in `Symtab->addFile(Obj);` (which invokes the `parse()` method), and at that point it's, at least semantically, a bit too late to back out.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63109/new/

https://reviews.llvm.org/D63109





More information about the llvm-commits mailing list