[lld] [lld][ELF] Skip finalizeAddressDependentContent if assignAddresses produces errors. (PR #75581)

Bevin Hansson via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 21 00:24:50 PST 2023


================
@@ -28,7 +28,7 @@
 # CHECK-NEXT: 0000000000001000 A newsym
 
 # RUN: not ld.lld -T chain2.t a.o 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:
-# ERR-COUNT-3: error: chain2.t:1: symbol not found: undef
+# ERR-COUNT-2: error: chain2.t:1: symbol not found: undef
----------------
bevin-hansson wrote:

Right. So in order to prevent this error from showing up twice, we'd have to stop finalizeAddressDependentContent from running at all if there were any errors prior to it. But like you said, this prevents the mapfile from being filled in properly.

I'm not sure if this is ideal. Even if there are errors, having an accurate mapfile is very useful. My intent was just to prevent the errors in assignAddresses from showing up again when we already know that they are going to happen.

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


More information about the llvm-commits mailing list