[lld] [llvm] [LLD][COFF] Make unresolved symbol search behavior compliant with MSVC link.exe (PR #85290)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 24 13:39:28 PDT 2024
================
@@ -286,6 +286,15 @@ class DefinedSynthetic : public Defined {
uint32_t offset;
};
+// Keep track of symbols with the same name exposed by archives. This is
+// required to later resolve unresolved symbols in the same order as required
+// by the MSVC spec. These are indexes in the specific bump allocator for
+// SymbolUnion.
+struct LazyIntrusiveNode {
+ uint32_t next = 0;
+ uint32_t last = 0;
+};
----------------
cjacek wrote:
I assume it uses indices instead of pointers to avoid enlarging `SymbolUnion`. If that’s the case, perhaps we could avoid storing last. To maintain O(1) insertion, we could always insert the element just after the front element. The order would then be almost reversed: (first), (last), (second to last), (third to last), and so on. Lookup would need to compensate by returning either the front or the last matching element. With the saved space, we could store next as a pointer and eliminate the need for `fromAlignedIndex`.
https://github.com/llvm/llvm-project/pull/85290
More information about the llvm-commits
mailing list