[lld] [LLD] Tombstone LocalTU entry in .debug_names (PR #70701)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 13:21:04 PDT 2023


================
@@ -947,6 +947,22 @@ void InputSection::relocateNonAlloc(uint8_t *buf, ArrayRef<RelTy> rels) {
       //
       // TODO To reduce disruption, we use 0 instead of -1 as the tombstone
       // value. Enable -1 in a future release.
+
+      if (isDebugNames && dyn_cast<Undefined>(&sym)) {
+        uint64_t maxVal = 0;
+        switch (type) {
+        case R_X86_64_64:
+          maxVal = llvm::maxUIntN(64);
+          break;
+        case R_X86_64_32:
+          maxVal = llvm::maxUIntN(32);
+          break;
+        default:
+          llvm_unreachable("Unsupported relocation type in .debug_names.");
+        }
----------------
dwblaikie wrote:

Be nice to hear from @MaskRay or otherwise about whether we can generalize this in some way.

@ayermolo perhaps you can check the commit history to see how the `-1 as tombstone` worked - it was committed a few years back, so there might be some hint about how to do that that doesn't require special casing each relocation 

https://github.com/llvm/llvm-project/pull/70701


More information about the llvm-commits mailing list