GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
aarch64 Performance Win

Add PIC/PIE support to large model

Added Position Independent Code (PIC) and Position Independent Executable (PIE) support to the AArch64 large memory model, improving code size.

This commit introduces PIC/PIE support for the AArch64 large memory model. It uses an indirection via the Global Offset Table (GOT) for data accesses that might be out of range of ADRP, avoiding relro symbol references in literal pools and allowing trivial PIC/PIE support. The code quality is improved and SPEC2017 codesize reduces by 2.2%.

In Details

This commit modifies aarch64.cc to enable PIC/PIE in the large model. It removes the forced symbol references to const memory and uses SYMBOL_SMALL_ABSOLUTE for constant references and SYMBOL_SMALL_GOT_4G for writeable data. This avoids placing relro symbol references in literal pools. This change is relevant to AArch64 toolchain developers working on code generation and memory models.

For Context

Position Independent Code (PIC) and Position Independent Executable (PIE) are techniques that allow code to be loaded at different memory addresses without requiring modification. This commit enables PIC/PIE for the AArch64 architecture's large memory model in GCC. By using the Global Offset Table (GOT) for data access and loading code at arbitrary addresses, this improves code size and flexibility, particularly for large applications that need to run in various memory environments.

Filed Under: aarch64PICPIEcode sizeoptimization