binutils Newspaper
JUNE 16, 2026
aarch64 Proposed

Aarch64: Fix ldst_lo12_determine_real_reloc_type

Improve relocation type determination for load/store instructions and remove unused function `aarch64_get_expected_qualifier`.

This patch improves the ldst_lo12_determine_real_reloc_type function by adding fallback handling for invalid operand qualifiers, preventing assertions when encountering X registers in byte or half instructions. It also simplifies the code by inlining parts of aarch64_get_expected_qualifer and directly deducing the array index from qualifier enum values. As a result, the aarch64_get_expected_qualifier function becomes unused and is removed, simplifying the codebase.

In Details

In the AArch64 backend, ldst_lo12_determine_real_reloc_type determines the relocation type for load/store instructions with a 12-bit offset. This patch improves the function's robustness and removes the unused aarch64_get_expected_qualifier in gas/config/tc-aarch64.c, simplifying the relocation process.

For Context

When code is compiled, the compiler sometimes needs to insert placeholders for memory addresses that will only be known later. These placeholders are called relocations. This patch improves how the assembler determines the correct type of relocation to use for certain load and store instructions, and it also removes a function that's no longer needed, making the assembler's code cleaner.

Filed Under: aarch64assemblerrelocationload/storecode cleanup