binutils Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
loongarch

LoongArch: Fix readelf test for instruction alignment.

Adjusts a readelf test for LoongArch to correctly verify 4-byte alignment of machine instructions in both 32-bit and 64-bit objects.

A readelf test for LoongArch was failing on 32-bit objects because it was over-specifying the expected output. This commit modifies the test to be less specific, ensuring that it correctly verifies the 4-byte alignment of machine instructions for both loongarch32 and loongarch64.

In Details

This patch modifies the insn_align_4.d test in the LoongArch assembler testsuite. The original test's readelf check was too strict, causing failures on 32-bit objects. The fix loosens the regex to verify the presence of '.text' section with alignment of 4 bytes rather than matching the entire line.

For Context

The GNU assembler (gas) translates assembly code into machine code. This commit fixes a test case for the LoongArch architecture that checks whether machine instructions are properly aligned in memory. Correct alignment is crucial for performance. The fix ensures that the test works correctly for both 32-bit and 64-bit LoongArch programs, by relaxing the matching criteria in the test.

Filed Under: assemblerloongarchtestsuitealignment