Skip to content

[RISCV][lld?] Instruction relaxation information is not generated during partial linking with LTO #59350

@vsukhoml

Description

@vsukhoml

When input object files are machine code compiled with -mrelax and containing RELAX records partial linking (lld --relocatable) produce expected result:
36: 97 00 00 00 auipc ra, 0
00000036: R_RISCV_CALL_PLT memcpy
00000036: R_RISCV_RELAX ABS
3a: e7 80 00 00 jalr ra
3e: 13 05 f4 02 addi a0, s0, 47

Same code when source is IR object file produced with -flto and compiled/linked as lld --relocatable:
36: 97 00 00 00 auipc ra, 0
00000036: R_RISCV_CALL_PLT memcpy
3a: e7 80 00 00 jalr ra
3e: 13 05 f4 02 addi a0, s0, 47

Metadata

Metadata

Assignees

No one assigned

    Labels

    LTOLink time optimization (regular/full LTO or ThinLTO)backend:RISC-V

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions