aarch64: Fix PAuth_LR tests for aarch64-pe
Fixes alignment issues in aarch64 PAuth_LR tests for the PE/COFF target by using `.org` instead of `.balign` and adjusting expected output.
This patch addresses an issue in the aarch64 assembler’s tests for PAuth_LR (Pointer Authentication for Link Register). The tests used .balign 0x40000, which caused alignment errors on the aarch64-pe (PE/COFF) target because the required alignment (2^18) is not representable. The fix replaces .balign with .org to achieve the desired offset and modifies the test’s expected output to match the PE/COFF specific .text+... spelling.
- proposer
Submits a patch to fix alignment issues in aarch64 PAuth_LR tests for the PE/COFF target by replacing `.balign` with `.org` and adjusting expected output.
“Fix it by using .org directive and modify the test's expected output to match PE/COFF,s .text+... spelling.”
In Details
This patch corrects issues in the GAS test suite for the aarch64 architecture, specifically concerning Pointer Authentication (PAuth) and the Link Register (LR), when targeting the PE/COFF object file format (used on Windows). The original tests employed .balign 0x40000 to pad sections, but this large alignment value is not supported on PE targets. The fix replaces .balign with .org to achieve the correct spacing and adjusts the expected disassembly output to conform to the PE/COFF convention of representing addresses relative to the section start (.text+...).
- PAuth_LR
- Pointer Authentication for the Link Register. A security feature that uses cryptographic hashes to protect the return address stored in the LR register from being tampered with.
- aarch64
- The 64-bit ARM architecture.
- PE/COFF
- Portable Executable/Common Object File Format. The standard file format for executables, object code, and DLLs in Windows operating systems.
- .balign
- An assembler directive used to pad the current location to a specified alignment boundary, inserting NOPs or zero bytes as needed.
- .org
- An assembler directive that sets the current location counter to a specified value. If the new value is greater than the current location, it is typically filled with zeros or NOPs.
- Link Register (LR)
- In ARM architectures, the Link Register holds the return address for function calls.