[llvm-branch-commits] [lld] release/22.x: [lld][ELF] Fix crash when relaxation pass encounters synthetic sections (PR #186725)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Mar 18 01:20:06 PDT 2026


wangleiat wrote:

> When was this problem introduced or has it been present all along?

This issue has been present for a long time but remained latent.

Before #166323, synthetic sections had a shadowed `size` field.
The relax pipeline uses the base class `InputSection::size`, which was typically zero for these sections, so they were effectively skipped.

After that change removed the shadowed field and unified `size`, these sections started to have a non-zero size visible to the relax pipeline, and were incorrectly processed, leading to the crash.

So this is not a newly introduced bug, but rather an existing issue in the relax logic that was exposed by that refactoring.

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


More information about the llvm-branch-commits mailing list