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

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 11:44:02 PDT 2019


mstorsjo added a comment.

In D63109#1555283 <https://reviews.llvm.org/D63109#1555283>, @thakis wrote:

> Sorry for not replying, I'm on vacation.


Oh - sorry for bothering you with this issue then.

> I've learned that link.exe's /wholearchive is buggy and will do what you'd expect in a future release. So it's going to match lld's current behavior.

Ok, that's great news, that makes things a bit more consistent at least.

> A rsrc section contains a tree structure of all resources. Since those don't get merged, if you hit this diag you _will_ get incorrect output.

Yes, you obviously won't get the contents of both resources. But will the contents of the first resource object be accessible and the other one ignored, or will things get messed up even further? In the VLC case, it's not data resources that something would try to load, which would be missed and things would fail. It's just two identical copies of a `VERSIONINFO` struct.

> I don't care too much about mingw, but it might make more sense to fix the project running into this, and if that takes a long time, maybe add a /force: thingy for this to downgrade the error to a warning only if users explicitly ask for it.

Yes, fixing the project triggering it would of course be ideal; in this case it's not too trivial unfortunately. As GNU ld doesn't error out on these, demoting the error to a warning feels like a tolerable strategy to me.


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