GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
s390 Performance Win

s390: Align __mcount_loc entries to support packed relative relocations.

s390 profiling entries (__mcount_loc) are aligned to enable packed relative relocations in position-independent code.

This change aligns the entries of __mcount_loc on s390 systems, similar to x86. Previously, without explicit alignment, the linker could not use packed relative relocations (RELR) for these entries in position-independent output. Aligning them to their size ensures efficient relocation handling.

In Details

The s390 architecture's -mrecord-mcount option generates __mcount_loc entries. Without explicit alignment, these entries default to the architecture's natural alignment, preventing the linker from using compact RELR relocations. This commit enforces alignment to the size of each entry, enabling RELR for PIC/PIE output, similar to a previous x86 fix.

Filed Under: s390profilingrelocation