[PATCH v2] Support multiple .eh_frame sections
Nick Clifton
nickc@redhat.com
Wed Nov 2 12:21:23 GMT 2022
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/
> _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;
> + 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.
Cheers
Nick
More information about the Binutils
mailing list