[llvm-dev] [LLD] Linker Relaxation

Rafael Avila de Espindola via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 12 11:07:56 PDT 2017


PkmX via llvm-dev <llvm-dev at lists.llvm.org> writes:
> Note that RISC-V also handles alignment as part of relaxation, so it
> isn't really optional. For example:
>
> _start:
>     mv      a0, a0
>     .p2align 2
>     li      a0, 0
>
> The assembler inserts a 3-byte padding (note: this behavior isn't
> merged yet, see: https://github.com/riscv/riscv-binutils-gdb/pull/88):

Why 3 bytes? The assembler knows the section alignment.

I can see why another relaxation would require alignments to be
revisited, but it should be possible to link without any relaxations,
no?

Cheers,
Rafael


More information about the llvm-dev mailing list