I'm working on file iterator that decide if macho file is runnable or not, and like to add quick check according to file size.
It seems like there's no real limitation about macho minimum size, but is there a lower limit valid macho size.
This means that files below this size that are identified as macho by the 0xfeedface/0xfeedfacf prefix, couldn't be executed).
According to the Macho structure, it should contain macho-headers and load-commands that may point to additional segments.
And if there's such specified limit, how can I compile/create such file whose size is the limit.
I guess that such file would contain only single load command header ,that point to the minimal code .. it wouldn't linked to any dylib, contain static data, global variables, etc.. but when I compile simple main command that return 0, it's still linked to /usr/lib/libSystem.B.dylib
rough lower boundary
thanks
Someone wrote exactly this, tiny.s. It runs for earlier versions of OSX: