[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 13 10:16:50 PDT 2026


================
@@ -0,0 +1,37 @@
+# REQUIRES: loongarch
+# RUN: rm -rf %t && split-file %s %t
+# RUN: llvm-mc --filetype=obj -triple=loongarch64 -mattr=+relax %t/a.s -o %t/a.o
+
+## Do not crash when we encounter a synthetic section (like .got) that has
+## been placed inside an executable output section via a linker script.
+## Synthetic sections do not have relaxAux data structures initialized.
+
+# RUN: ld.lld -T %t/a.ld %t/a.o -o %t/nopie
----------------
MaskRay wrote:

OK. I think we need a different synthetic section to add the coverage, but it's unnecessary for this patch.

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


More information about the llvm-commits mailing list