Re: [PATCH v3] PE/COFF: raise normal PE section limit safely
Jan Beulich <[email protected]>
| Newsgroups | gmane.comp.gnu.binutils |
|---|---|
| Message-ID | <[email protected]> |
On 10.07.2026 15:14, Oleg Tolmatcev wrote: > Am Fr., 10. Juli 2026 um 15:03 Uhr schrieb Jan Beulich <[email protected]>: >> >> 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? I think I could live with that. > Otherwise I don't know what to do. Well, I did outline one option. Sooner or later proper error handling will want adding anyway, imo. But yes, it doesn't need to be you who does it. Jan