[PATCH] D116946: [ELF] Use tombstone values for discarded symbols in relocatable output

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 10 23:31:01 PST 2022


MaskRay added a comment.

`InputSection::relocateNonAlloc` takes significant time in the --time-trace metric `Write sections`.

Now a relocatable link runs both relocateNonAllocForRelocatable and relocateNonAlloc, making it even slower. -r performance is less important than executable/shared, but I wonder whether we can do something better.



================
Comment at: lld/ELF/InputSection.cpp:945
+    // sections.
+    if (expr != R_ABS && expr != R_DTPREL && expr != R_GOTPLTREL &&
+        expr != R_RISCV_ADD) {
----------------
Maybe it's time to swap `then` and `else`.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116946



More information about the llvm-commits mailing list