alexfru wrote:
In my understanding the problem is that there's a lot of stuff modern compilers put into executables and one needs to either understand all of it and properly handle it or find a sure way to simplify things to a manageable level. This is exacerbated by the fact that things keep changing (optimizations, options, sections change) and old recipes and shortcuts may stop working any time you pick up a newer version of the compiler (everybody seems to like new toys!).
That's obviously not true (you don't have to update your Linux/Windows/whatever every time there's a new compiler). As long as you stick to the specifications for the binary format you're using, the compiler used (and its options and optimisations) aren't important.
e.g. In order to load and run a statically-linked ELF executable, you only have to read and parse the file's program headers. The "sections" (.text, .data, etc.) aren't even used. You don't need to understand any of the "extra stuff" like the symbol table, debugging data, etc.
Sure, if you're using your own custom binary format or something equally esoteric, a less advanced compiler might be easier to understand and adapt. Otherwise, stick to the binary format's specifications, don't take "short cuts" and you'll be fine.
Still wondering what "zq" wants to achieve... If all that's needed is a smaller file, there's always the "strip" command...