[lld] [LLD, MachO] Add `getUnwindInfoEncodingHash` to `BPSectionOrderer.cpp`. (PR #105587)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 23 11:06:05 PDT 2024
================
@@ -60,6 +61,30 @@ getRelocHash(const Reloc &reloc,
return getRelocHash(kind, sectionIdx.value_or(0), 0, reloc.addend);
}
+// Get a hash of the unwind info (after relocation).
+// This hash is not 100% accurate, but it's good enough for compression.
----------------
ellishg wrote:
One key point is we want these hashes to be deterministic. Otherwise builds could end up with non-determinstic function order, which is what the `lld/test/MachO/bp-section-orderer-stress.s` aims to prevent. So this is why we cannot simply hash the personality pointer, even though that is what we'd like to do. I think it makes sense to include the symbol type in the hash if that's possible.
https://github.com/llvm/llvm-project/pull/105587
More information about the llvm-commits
mailing list