[PATCH] bfd: make _bfd_section_size_insane part of the public API
Jan Beulich
jbeulich@suse.com
Thu Jan 11 08:23:29 GMT 2024
On 10.01.2024 17:20, Andrew Burgess wrote:
> We're talking about the same _bfd_section_size_insane in bfd/section.c,
> right?
>
> I don't see any arbitrary limit in there. If there is such a limit then
> it's buried within all the very non-arbitrary sanity checks.
>
> This function isn't answering: "is this section larger than X", it is
> instead answering: "can this section possibly be read from this file".
Hmm, first of all I have to apologize for having gone from memory, having
looked at the function only when I first saw your patch. Yet then what
you're talking about is merely the final check of the function, which I'd
view as fine to externalize. The whole rest of the function still seems
pretty (but not exclusively) heuristic to me.
Anyway, Alan has indicated approval of making the function external, even
as-is. If I was to make a suggestion beyond the possible renaming /
inverting of sense, that would be to split the function into an "is valid"
part and an "is sane" one, with the latter kept internal.
Jan
More information about the Binutils
mailing list