Skip to content

Merge RISC-V LLD Code-Size Optimizations into Main

Os requested to merge zgq-code-size-clean into base-7791a95574

This merge integrates the RISC-V LLD code-size optimization changes into the main branch.

The main changes include:

  1. Weighted GP selection and writable data section reordering;
  2. Function-level InputSection splitting;
  3. Independent garbage collection for split functions;
  4. Safe identical code folding for split functions;
  5. Link-time relaxation from JAL to C.J/C.JAL;
  6. Cleanup of related configuration options, tests, and documentation.

The relevant tests have been completed successfully. Program correctness is preserved, and the optimized version achieves a reduction in the final executable size compared with the original version.

Merge request reports