[llvm] Put large common blocks into .lbss for the medium and large code models (PR #161483)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 2 20:30:38 PDT 2025


MaskRay wrote:

First, could you provide justification for why we need to make changes related to COMMON blocks? These have been obsolescent since the Fortran 90 standard and were deleted entirely from Fortran 2018.
The large common feature is only available for x86-64 and not even supported on other popular 64-bit architectures like AArch64.

Two main concerns with the proposed changes:

Increasing sizeof(MCSymbolELF) negatively impacts memory usage.
The modifications to lld/ELF/InputFiles.cpp add overhead for all users, even though the large common feature is quite niche.

---

SHN_AMD64_LCOMMON is a Solaris-specific constant name, not used by glibc/binutils.
We can use SHN_X86_64_LCOMMON instead.

For 161697, I don't think we should add `LbssSection`. Just reuse `BssSection`.
I am more concerned with the lld/ELF/InputFiles.cpp change, which adds overhead to every user not using the niche large common feature.


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


More information about the llvm-commits mailing list