[PATCH v2] LoongArch: Add bad static relocation check and output more information to user

mengqinggang mengqinggang@loongson.cn
Wed Jun 19 07:05:47 GMT 2024


I'm sorry, this empty email was sent carelessly.


在 2024/6/19 下午2:53, mengqinggang 写道:
>
> 在 2024/6/18 下午5:45, Xi Ruoyao 写道:
>> On Fri, 2024-04-19 at 17:59 +0800, Lulu Cai wrote:
>>>       case R_LARCH_ABS_HI20:
>>>       case R_LARCH_SOP_PUSH_ABSOLUTE:
>>> +      if (bfd_link_pic (info))
>>> +        return bad_static_reloc (abfd, rel, sec, r_type, h,
>>> isym);
>> Hi,
>>
>> This has broken linking the object files created by gas-2.38 with ld
>> from Binutils trunk.  In the era of gas-2.38 we used
>> R_LARCH_SOP_PUSH_ABSOLUTE heavily even with -fPIC:
>>
>> 0000000000000000 <_start>:
>>     0:    1c000004     pcaddu12i       $a0, 0
>>             0: R_LARCH_SOP_PUSH_PCREL    _start+0x800
>>             0: R_LARCH_SOP_PUSH_ABSOLUTE    *ABS*+0xc
>>             0: R_LARCH_SOP_SR    *ABS*
>>             0: R_LARCH_SOP_POP_32_S_5_20    *ABS*
>>     4:    02c00084     addi.d          $a0, $a0, 0
>>             4: R_LARCH_SOP_PUSH_PCREL    _start+0x4
>>             4: R_LARCH_SOP_PUSH_PCREL    _start+0x804
>>             4: R_LARCH_SOP_PUSH_ABSOLUTE    *ABS*+0xc
>>             4: R_LARCH_SOP_SR    *ABS*
>>             4: R_LARCH_SOP_PUSH_ABSOLUTE    *ABS*+0xc
>>             4: R_LARCH_SOP_SL    *ABS*
>>             4: R_LARCH_SOP_SUB    *ABS*
>>             4: R_LARCH_SOP_POP_32_S_10_12    *ABS*
>>     8:    4c000020     jirl            $zero, $ra, 0
>>     c:    03400000     andi            $zero, $zero, 0x0
>>
>> Now to me maintaining the support of those stack-based reloc types has
>> been a burden.  Should we just remove the support in the upcoming 2.43
>> release, or make them deprecated (with a warning) in 2.43 and remove the
>> support in 2.44?
>>



More information about the Binutils mailing list