Issues on Sframe on LoongArch with Link Time Relexation

Huang Pei huangpei@loongson.cn
Thu Sep 18 13:00:45 GMT 2025


Hi, everyone,

when I try to add Sframe support for LoongArch, it occurred to me
that the current implementation assumed no code relaxation during 
link editing, which causes two issues:

+. ld triggered the "sframe_assert" from "sframe_decoder_get_fre",
since the sfde_func_size (with R_LOONGARCH_{ADD32,SUB32}) is not 
resolved at the time because of link time relaxation.(This may
not be an issue on RISC-V).

+. relax "rs_sframe" is not safe any more within gas, it need 
relocs on sfre_start_address, and delayed until link editing.

-mno-relax(and -mthin-add-sub) in LoongArch gas can work around two
issues, but any advice if not?



More information about the Binutils mailing list