AArch64: Fix ldst_lo12_determine_real_reloc_type
The AArch64 assembler now correctly handles invalid operand qualifiers when determining relocation types for load/store instructions.
This commit fixes a bug in ldst_lo12_determine_real_reloc_type that caused an assertion failure when using X registers in byte or half instructions with invalid operand qualifiers. The fix adds fallback handling for an invalid choice of opd0_qlf and simplifies the code by inlining parts of aarch64_get_expected_qualifer and deducing the array index directly from the qualifier enum values. As a result, aarch64_get_expected_qualifier is now unused and has been removed.
In Details
The function ldst_lo12_determine_real_reloc_type in gas/config/tc-aarch64.c determines the appropriate relocation type for load and store instructions with a LO12 offset. The function relies on operand qualifiers to determine the size of the data being loaded or stored. This commit improves the robustness of this function by adding fallback handling for invalid operand qualifiers and simplifying the code.
For Context
When assembling AArch64 instructions, the assembler needs to generate relocation entries that tell the linker how to adjust addresses in the code. This commit fixes a bug in the assembler's relocation logic for load and store instructions, ensuring that the correct relocation entries are generated even when the instruction contains invalid operand qualifiers. This makes the assembler more robust and prevents potential errors during linking.