[RFC] RISCV: Align using RVC insns
Patrick O'Neill
patrick@rivosinc.com
Mon Mar 28 22:19:41 GMT 2022
On 3/28/22 00:54, Jan Beulich wrote:
> 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
>
Jan,
Thank you for the link, I just opened a pull request proposing the
addition of this relocation type.
Patrick
More information about the Binutils
mailing list