[PATCH] D104353: [lld-macho] Avoid force-loading the same archive twice

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 18 19:27:15 PDT 2021


int3 added a comment.

The real culprit is https://github.com/llvm/llvm-project/commit/1d31fb8d122b1117cf20a9edc09812db8472e930, which I (unfortunately) thought simple enough to be landed without review. And I only landed it today, which explains why the breakage only happened today.

The issue is that it made `rerootPath` return a temporary `std::string` instead of an interned string, which then gets passed to `addFile` as a StringRef, so it gets prematurely freed.

I'll back out the std::string change and re-land this force-load diff.



================
Comment at: lld/test/MachO/force-load.s:26
+
+# DUP: error: duplicate symbol: _bar
+
----------------
thakis wrote:
> Hm, there's no FileCheck line with --check-prefix=DUP…
whoops. I'll fix it as part of the re-land.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104353



More information about the llvm-commits mailing list