ld: RISC-V: Zcmt tests emulation selected
Patch to select correct emulation for RISC-V Zcmt tests has been merged.
Jiawei has merged a patch that corrects the emulation selection for RISC-V Zcmt tests. The tests, which primarily assemble RV64 objects, previously defaulted to ELF32 on riscv32-elf, causing them to be rejected before reaching the relaxation or jump table inspection stages. The patch sets the emulation to LP64 for this test group and adjusts endianness handling.
- maintainer
Merged the patch after positive review and acknowledgment of a reported issue.
“Pushed, thanks for the review and report.”
- reviewer
Reviewed and approved the patch.
“LGTM”
- proposer
Submitted a patch to select the matching emulation for RISC-V Zcmt tests.
“Most table-jump tests assemble RV64 objects. On riscv32-elf the linker defaults to ELF32 and rejects those objects before the tests reach the relaxation or inspect the jump table. Select LP64 for this group and use the target byte order for the cases that specify their own XLEN. Keep the explicit little- and big-endian tests in their respective emulations. Use objdump -z in tests that inspect s…”
In Details
This merged patch addresses a test suite configuration issue for RISC-V within the GNU linker (ld). The Zcmt tests, which focus on table-jump instructions and potentially relaxation, were failing on 32-bit RISC-V targets because the linker defaulted to an ELF32 emulation instead of the required LP64 (64-bit Linux). The fix ensures the correct emulation is selected, allowing these tests to run as intended. Additionally, it refines how sparse jump tables are inspected using objdump -z on big-endian systems.
- ld
- The GNU linker, responsible for combining object files and libraries into an executable or another object file.
- RISC-V
- An open-standard instruction set architecture (ISA) based on RISC principles, increasingly adopted for various computing applications.
- emulation
- In this context, refers to the linker's interpretation of the target architecture and ABI (Application Binary Interface), which affects how object files are processed.
- LP64
- A data model where
longand pointer types are 64 bits, commonly used in 64-bit Unix-like systems. Contrasts with ILP32 whereintis 32 bits andlong/pointers are 64 bits. - ELF32
- The 32-bit version of the Executable and Linkable Format, a common standard for object file formats.
- relaxation
- A linker optimization technique where the linker adjusts branch offsets and other relative addressing information to produce smaller or more efficient code.
- objdump
- A command-line utility that displays information from object files, including disassembled code.