[lld] [lld][ELF] Add --print-relax-stats= to emit linker relaxation statistics (PR #193631)

Farid Zakaria via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 22 17:53:56 PDT 2026


fzakaria wrote:

The two commits represent two different ways I explored on capturing the statistic.
The first commit did it inline during `relocAll` and required then a mutex to guard the statistic due to parallel InputSection handling.
The second commit chose to do it as a single pass at the end but it added an extra flag to keep track of which relocation was relaxed*

* this could also be done by checking `rel.expr` but I found that personally difficult to keep track of. I much rather a `was_relaxed()` method on a class or a single field. I chose the single boolean field for now.

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


More information about the llvm-commits mailing list