RISC-V alignment handling considers worst-case RVC relaxation
RISC-V assembler now reserves up to 2 bytes for alignment when relaxation is enabled and RVC code is present.
The RISC-V assembler has been updated to account for potential code shifts caused by RVC (RISC-V Compressed) instruction relaxation. When relaxation is enabled and RVC code precedes a region requiring alignment, the assembler now reserves up to two bytes to prevent alignment gaps from becoming too small. This ensures correct alignment in scenarios where relaxed RVC instructions might alter code placement.
In Details
This commit addresses alignment handling in the RISC-V assembler, specifically when relaxation is enabled and the code contains RVC instructions. RVC instructions are 16-bit, while standard RISC-V instructions are 32-bit. Relaxation allows the assembler to replace 32-bit instructions with equivalent 16-bit RVC instructions where possible. However, this replacement can change the code's byte offset, potentially affecting subsequent alignment directives. This change modifies gas/config/tc-riscv.c to use a 2-byte worst-case alignment when RVC is present and relaxation is on, ensuring that rese…