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.