[lld] [lld][ELF] Fix crash when relaxation pass encounters synthetic sections (PR #184758)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 6 00:21:54 PST 2026


================
@@ -1685,8 +1685,11 @@ bool LoongArch::relaxOnce(int pass) const {
   for (OutputSection *osec : ctx.outputSections) {
     if (!(osec->flags & SHF_EXECINSTR))
       continue;
-    for (InputSection *sec : getInputSections(*osec, storage))
+    for (InputSection *sec : getInputSections(*osec, storage)) {
+      if (!sec->relaxAux)
----------------
MaskRay wrote:

```
for ...
  if 
    changed |= ..
```

since the body has just one line.

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


More information about the llvm-commits mailing list