[PATCH 1/4] RISC-V: Refactor PLT generation
Kito Cheng
kito.cheng@gmail.com
Wed Jun 11 08:05:12 GMT 2025
>> - for (i = 0; i < PLT_ENTRY_INSNS; i++)
>> - bfd_putl32 (plt_entry[i], loc + 4*i);
>>
>> /* Fill in the initial value of the .got.plt entry. */
>> loc = gotplt->contents + (got_address - sec_addr (gotplt));
>
>
> Can we also move these initial steps into make_plt_entry?
> /* Fill in the initial value of the .got.plt entry. */
> loc = gotplt->contents + (got_address - sec_addr (gotplt));
> bfd_put_NN (output_bfd, sec_addr (plt), loc);
>
> "rela.r_offset = sec_addr (gotplt) + got_offset", so that we don't need got_address above.
I prefer those codes kept in there since all other PLT are also using
the same logic as well.
More information about the Binutils
mailing list