RISC-V: Add new relocation types for global array accesses with non-constant indices
Adds new relocation types to RISC-V support for efficient global array access with non-constant subscripts.
This patch introduces new RISC-V relocation types (R_RISCV_BASE_IDX_*) to the binutils project. These relocations are designed to enable more efficient code generation for global array accesses where the array subscript is not a compile-time constant. The changes affect BFD, GAS, and header files, and include new test cases.
In Details
Adds new BFD relocation types (R_RISCV_BASE_IDX_*) and corresponding GAS support for RISC-V. This facilitates compiler optimization for global array accesses with non-constant indices by allowing the linker to better resolve addresses, potentially reducing runtime overhead. It aligns with the RISC-V PSABI specification.
- Relocation
- The process of modifying code or data in an object file to allow it to be loaded at a different address in memory than it was originally compiled for. Relocations are typically handled by the linker.
- RISC-V
- A free and open instruction set architecture (ISA) based on RISC principles.
- PSABI
- Platform-Specific Application Binary Interface. Defines conventions for how software components interact at the binary level for a specific platform.
- BFD
- Binary File Descriptor library. A library used by binutils for manipulating object files in various formats.
- GAS
- The GNU Assembler, part of the GNU Binutils.