On 22.04.2008 02:21, Jeremy Jackson wrote:
On Tue, 2008-04-22 at 02:03 +0200, Carl-Daniel Hailfinger wrote:
You can use binutils, but the resulting file is still too big for my taste after compression. That's why my script did lots of dirty tricks to squeeze binutils output down do an absolute minimum.
Well now I'm curious, what else does binutils leave lying around, surely the text/data sections are no different... the section headers/program headers shouldn't be very big. Any other sections can probably be dropped given the right commands/options.
When you're optimizing for size, shaving off a hundred bytes of header and other assorted stuff does matter. Absolute minimum is a file which has no header, keeps all required symbol names sorted by name as consecutive zero-terminated strings, followed by a zero byte, followed by an array of addresses. The name list can be compressed with algorithms suited best for sorted printable strings and/or the whole file can be compressed with lzma.
Regards, Carl-Daniel