[PATCH v3] PE/COFF: raise normal PE section limit safely
Oleg Tolmatcev
oleg.tolmatcev@gmail.com
Fri Jul 10 13:14:57 GMT 2026
Am Fr., 10. Juli 2026 um 15:03 Uhr schrieb Jan Beulich <jbeulich@suse.com>:
>
> On 06.07.2026 00:07, Oleg Tolmatcev wrote:
> > @@ -927,6 +933,8 @@ fill_comdat_hash (bfd *abfd)
> > flagword sec_flags = SEC_LINK_ONCE;
> >
> > bfd_coff_swap_sym_in (abfd, esym, &isym);
> > + if (bfd_get_error () == bfd_error_bad_value)
> > + return false;
>
> Taking this as example (applies at all use sites): I'm not sure what to say.
> What if bfd_coff_swap_sym_in() worked fine and something else left an error
> latched in libbfd? This kind of indirect error checking feels pretty
> fragile. If already all use sites of bfd_coff_swap_sym_in() need touching
> anyway, can't the function be changed to properly report a success indicator?
>
> Having said "all" - you don't really amend all call sites, do you? The
> description says nothing as to how the selection was made.
I wanted to keep the changes to error handling minimal, but now I think
that I shouldn't have touched it at all. The original code did not do any
error handling either. If the only thing wrong with v1 of the patch
was the assert,
should I just remove the assert from it and be done with the patch? Otherwise
I don't know what to do.
Oleg
More information about the Binutils
mailing list