LoongArch: Optimize linker relaxation by emitting fewer relocations
A series of patches for LoongArch binutils aims to reduce relocations during linker relaxation, improving efficiency.
This is the cover letter for a series of four patches intended to optimize linker relaxation for LoongArch targets within the binutils project. The patches address issues with TLS descriptor relocations, consolidate relaxed instructions, reduce relocations for label subtraction, and refine the emission of alignment relocations, all contributing to fewer generated relocations.
- proposer
Presents a series of four patches for LoongArch binutils focused on reducing relocations during linker relaxation.
“mengqinggang (4): LoongArch: Fix the size of tls desc relocations LoongArch: Do not emit relocation if addsy and subsy are in the same frag LoongArch: Emit fewer relocations for label subtraction LoongArch: Emit alignment relocations after relaxed instructions bfd/elfxx-loongarch.c | 8 +- gas/config/tc-loongarch.c | 230 ++++++++++---- ga…”
In Details
This is the cover letter for a series of patches submitted by mengqinggang that optimize linker relaxation for the LoongArch architecture within binutils. The series addresses several aspects: correcting the size of TLS descriptor relocations, preventing redundant relocations when addsy and subsy are in the same fragment, reducing relocations for label subtraction by considering relaxed instructions, and ensuring alignment relocations are emitted only after relaxed instructions. The overarching goal is to minimize the number of relocations the linker needs to process for LoongArch targets…
- linker relaxation
- A process where the linker adjusts addresses and offsets of code and data after initial assembly, often to optimize for space or speed, especially in position-independent code.
- LoongArch
- A RISC-V-based instruction set architecture developed by Loongson Technology.
- binutils
- A collection of programming tools for creating and managing executable programs, including the GNU Assembler (gas) and the GNU Binary File Descriptor library (BFD).
- relocations
- Information in an object file that describes how to modify addresses and references when the code is linked or loaded into memory.
- TLS
- Thread-Local Storage, a mechanism that allows variables to have distinct values for each thread of execution.
- frag
- A 'fragment', a basic unit of code or data within an assembler's intermediate representation, which eventually forms part of an object file section.