[PATCH v2] Support multiple .eh_frame sections

Jojo R rjiejie@linux.alibaba.com
Thu Nov 3 02:11:34 GMT 2022


在 2022/11/2 20:21, Nick Clifton 写道:
> Hi Jojo,
>
>>     This patch is based on MULTIPLE_FRAME_SECTIONS and 
>> EH_FRAME_LINKONCE,
>>     it allows backend to enable this feature and use '--gc-sections' 
>> simply.
>
> Do you (or your employer) have a copyright assignment on file with the 
> FSF for
> contributions to the GNU Binutils project ?  If not, are you willing 
> to contribute
> the patch with a DCO attached ? https://developercertificate.org/
>
Yes, we have signed the assignment of FSF :)
>
>>   _bfd_elf_default_action_discarded (asection *sec)
>>   {
>> +  const struct elf_backend_data *bed;
>> +  bed = get_elf_backend_data (sec->owner);
>> +
>> +  if (bed->elf_backend_can_make_multiple_eh_frame
>> +      && strncmp (sec->name, ".eh_frame.", 10) == 0)
>> +    return 0;
>> +
>>     if (sec->flags & SEC_DEBUGGING)
>>       return PRETEND;
>
> I think that this test would be better if it was moved down a few lines,
> until it was just after this test:
>
>   if (strcmp (".eh_frame", sec->name) == 0)
>     return 0;
>
Fixed.
>
>> +      exp.X_op = O_symbol;
>> +      exp.X_add_symbol = (symbolS *) local_symbol_make (cseg->name, 
>> cseg, 0, frch->frch_root);;
>> +      exp.X_add_number = 0;
>
> The arguments to local_symbol_make() are in the wrong order:
>
>   struct local_symbol *local_symbol_make (const char *, segT, fragS *, 
> valueT);
>
> Ie the frag should come before the value.
>
> Also there is a double semi-colon at the end of the line.
Fixed.
>
> Cheers
>   Nick


More information about the Binutils mailing list