[RFC] RISCV: Align using RVC insns
Jan Beulich
jbeulich@suse.com
Mon Mar 28 07:54:19 GMT 2022
On 26.03.2022 00:15, Patrick O'Neill wrote:
> Currently, .align and .balign directives only use nops to achieve
> alignment. On RVC targets, the linker can selectively compress
> instructions to achieve alignment without introducing nops.
>
> This increases the code size of unlinked binaries since instruction
> compression is deferred to the linker. Linked binaries with align
> directives may be smaller/run faster due to less nops.
>
> Binaries without align directives should be unaffected by this change.
>
> This change requires adding a reloc for compressable instructions. The
> addend of that reloc stores the compressed instruction's opcode.
>
> Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
May I ask where the specification for this lives? I've just pulled down
the latest version of the psABI, but that doesn't even mention the new
relocation type you use here. Going over
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues also didn't
turn up anything obvious.
Jan
More information about the Binutils
mailing list