bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/27381] New: out of memory with .incbin "directory/"


From: gnu at niksoggia dot it
Subject: [Bug gas/27381] New: out of memory with .incbin "directory/"
Date: Mon, 08 Feb 2021 23:38:06 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27381

            Bug ID: 27381
           Summary: out of memory with .incbin "directory/"
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: gnu at niksoggia dot it
  Target Milestone: ---

Created attachment 13210
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13210&action=edit
fail early when .incbin argument is a directory

Dear binutils developers,
we all know that .incbin expect files and not directories, but in this case gas
shows a misleading error message:

$ echo '.incbin "/etc/"' >will_it_fail.S && as will_it_fail.S
as: out of memory allocating 9223372036854841503 bytes after a total of 270336
bytes

There is no easy way out: fopen() fseek() and ftell() are happy with
directories.
The easiest C89 way out of the problem I can think of now is that read() in not
happy with directories.
For a better error message we could waste some I/O time before trying to
allocate 2^63 bytes, here is my idea.

Regards,

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]