RISC-V: Add Zcmt table-jump linker tests
Adds comprehensive linker tests for the Zcmt table-jump relaxation extension in RISC-V.
This patch introduces a suite of linker tests for the RISC-V Zcmt extension, which enables table-jump relaxation. The tests cover various aspects including table generation, profitability analysis, relocation handling, symbol management, relaxation ordering, and unsupported link modes. They exercise option parsing, global relaxation control, and verify that emitted relocations do not contain linker-private markers, ensuring the robustness of the Zcmt implementation.
In Details
This is the third patch in a series introducing Zcmt table-jump relaxation to GNU ld for RISC-V. This specific patch focuses on the test suite (ld/testsuite/ld-riscv-elf/) to validate the functionality added in the preceding patches. It defines new test cases (.d and .s files) to cover scenarios such as table generation, profitability, relocation and symbol handling, relaxation ordering, and unsupported link modes. It also exercises option parsing and global relaxation control, verifying emitted relocations and section garbage collection.
- RISC-V
- An open standard instruction set architecture (ISA) based on Reduced Instruction Set Computer principles.
- Zcmt
- A RISC-V standard extension that allows for table-jump relaxation, an optimization technique for jumps and calls.
- table-jump relaxation
- An optimization technique in linkers where indirect jumps or calls are replaced with a more efficient form, potentially using a jump table.
- linker
- A program that combines object files and libraries into an executable program.
- relocation
- The process of updating symbolic references and memory addresses in object code or executable files after compilation, typically performed by the linker.
- option parser
- The component of the linker responsible for interpreting command-line options provided by the user.
- relaxation
- An optimization process in linkers that adjusts code, such as branch offsets, to improve performance or reduce code size.