[PATCH v3 0/6] LoongArch linker relaxation support.

Fangrui Song i@maskray.me
Sat Dec 24 18:10:02 GMT 2022


On 2022-12-16, mengqinggang wrote:
>This is the v3 version of patches to support loongarch linker relax.
>The new relocs document at here:
>  https://github.com/loongson/LoongArch-Documentation/pull/77
>
>The patch set changelog:
>
>v2 -> v3:
>1. Fix ChangeLog entries, delete extra TABs.
>
>mengqinggang (6):
>  LoongArch: include: Add support for linker relaxation.
>  LoongArch: bfd: Add support for linker relaxation.
>  LoongArch: opcodes: Add support for linker relaxation.
>  LoongArch: binutils: Add support for linker relaxation.
>  LoongArch: gas: Add support for linker relaxation.
>  LoongArch: ld: Add support for linker relaxation.
>

Regarding relaxation, there is no hurry. It's a linked unit size
optimization (minor in many cases) with significant relocataion file
overhead and other costs (see
https://maskray.me/blog/2021-03-14-the-dark-side-of-riscv-linker-relaxation):
debug informtion, .gcc_except_table, unimplemented split DWARF, almost
all metadata sections anchoring text sections, ld --emit-relocs, etc.
RISC-V linker relaxation while used prevailingly due to GCC/Clang
default -mrelax, has many issues not sorted out. And some issues are in
inferior states due to backward compatibility.

My best advice is to postpone adding linker relaxation until every other
part is mature.


More information about the Binutils mailing list