RFA: Have gold's File_read::do_read() function check the start parameter (PR 23765)

Cary Coutant ccoutant@gmail.com
Tue Sep 3 04:57:00 GMT 2019


>   Attached is a small proposed patch for PR 23765.  The C++ coding may
>   not be all that good as I am not a C++ expert, but it does build and
>   test without introducing any new regressions.
>
>   OK to apply ?
>
> Cheers
>   Nick
>
> gold/ChangeLog
> 2019-08-06  Nick Clifton  <nickc@redhat.com>
>
>         PR 23765
>         * fileread.cc (File_read::do_read): Check start parameter before
>         computing number of bytes to read.

At this level, it's not really feasible to print a meaningful error
message for the user. I'd prefer that we use gold_assert() here, and
put error checks at the higher layers to ensure that if we get to this
point it truly is an internal error.

If it can wait, I'll extend the patch to do that when I'm back again.

-cary



More information about the Binutils mailing list