This is the mail archive of the
mailing list for the binutils project.
Re: [committed, PATCH] Check file size before getting section contents
On Mon, Jun 26, 2017 at 4:15 PM, Alan Modra <email@example.com> wrote:
> On Mon, Jun 26, 2017 at 03:49:12PM -0700, H.J. Lu wrote:
>> filesz = bfd_get_file_size (abfd);
>> + if (filesz < 0)
>> /* This should never happen. */
>> abort ();
> This will abort for 2G files on some host/target combinations. Why is
> that correct?
That is true. The problem is
bfd_get_size (bfd *abfd)
struct stat buf;
if (abfd->iovec == NULL)
if (abfd->iovec->bstat (abfd, &buf) != 0)
Why isn't it "ufile_ptr".