[PATCH] LoongArch: Fix wrong relocation handling of symbols defined by PROVIDE
ywgrit
wangxin03@loongson.cn
Thu Aug 15 03:14:09 GMT 2024
Thanks, I have did this, patch will send soon.
在 2024/8/15 上午11:03, Lulu Cai 写道:
> On 8/15/24 9:58 AM, ywgrit wrote:
>> la.abs is the way to get abs symbol, What I'd like to know is should
>> we disable la.global $a0, abs_sym when linking?
>> Here is an example.
>>
>> sym.s
>> .globl sym
>> sym=0x100
>>
>>
>> get_sym.s
>> .globl get_sym
>> get_sym:
>> la.global $a0, sym
>> ld.d $a0, $a0, 0
>>
>>
>> In get_sym.s, we want get a global symol, however sym is an absolute
>> symbol, and we couldn't know that until linking. This behavior is not
>> prohibited in the linker now. Should we just disable this behavior in
>> check_relocs or change linker so that we can get the absolute symbol
>> by just "la.global $a0, sym" without the following "ld.d $a0, $a0, 0"?
>
> For me I would prefer to change the linker so that we can use
> la.global $a0, sym to get the abs symbol.
More information about the Binutils
mailing list