RISC-V: Validate ALIGN relocation padding bounds
RFC proposes validating padding bounds for RISC-V ALIGN relaxation in the linker.
This RFC proposes a change to the RISC-V linker to validate that the padding required by the ALIGN relaxation fits within the input section. If the padding span exceeds the section boundaries, the linker should fail with a diagnostic. The author is seeking feedback and asking if this validation should be addressed concurrently with Bugzilla #34844, which concerns non-termination in the ALIGN path.
In Details
This RFC targets the RISC-V linker's handling of the ALIGN pseudo-instruction, specifically during the relaxation phase where padding is added to satisfy alignment requirements. The proposal aims to add bounds checking to ensure that the calculated padding does not exceed the limits of the section it belongs to. This is motivated by potential issues like non-termination or incorrect linking behavior, as referenced by Bugzilla #34844.
- ALIGN relaxation
- A linker optimization where the linker adjusts the layout of code or data to meet specific alignment requirements, potentially adding padding.
- RISC-V
- An open-standard instruction set architecture based on RISC principles.
- linker
- A program that combines object files and libraries into an executable program.
- padding
- Unused space inserted to meet alignment or other structural requirements.
- Bugzilla
- An open-source web-based bug tracking system used by many projects, including the GNU toolchain.