[PATCH 4/4] RISC-V: Support for unlabeled landing pad PLT generation
Kito Cheng
kito.cheng@gmail.com
Tue Jun 10 08:10:13 GMT 2025
>> @@ -5803,6 +5964,12 @@ elfNN_riscv_link_setup_gnu_properties (struct bfd_link_info *info)
>> bfd *pbfd = _bfd_riscv_elf_link_setup_gnu_properties (info, &and_prop);
>>
>> _bfd_riscv_elf_tdata (info->output_bfd)->gnu_and_prop = and_prop;
>> +
>> + if (and_prop & GNU_PROPERTY_RISCV_FEATURE_1_CFI_LP_UNLABELED)
>> + _bfd_riscv_elf_tdata (info->output_bfd)->plt_type = PLT_ZICFILP_UNLABELED;
>> +
>> + setup_plt_values (info, _bfd_riscv_elf_tdata (info->output_bfd)->plt_type);
>> +
>
>
> The plt_type of tdata was initialized to zero (PLT_NORMAL), and the plt values of htab were initialized in riscv_elf_link_hash_table_create. Therefore, just curious once the plt type of output is changed to cfi style (or whatever in the future), will it possible to change to others later? Which means, the setup_plt_values seems redundant to do stuffs for PLT_NORMAL? Or maybe we can just call "setup_plt_values (info, PLT_NORMAL)" in the riscv_elf_link_hash_table_create to initialize the ply values.
Good point, it seems like we duplicate that logic twice
(setup_plt_values and riscv_elf_link_hash_table_create), I can tweak
this patch a little bit to let riscv_elf_link_hash_table_create to
reuse that logic instead of duplicate twice :)
> Otherwise looks good, thanks.
>
> Nelson
More information about the Binutils
mailing list