Validate input at libelf level

This way we can just assume that stuff works later on and keep the code
clean and simple. It especially establishes that the file has a sane
format and is thus understandable and editable.
Clean up loader code
Turn elfu_gScnSizeFile into a macro
Turn elfu_gPhdrContainsScn into a macro
Abstract model more - break 'make check'

Sections are now sorted by file offset and sh_link dependencies between
them as well as PHDR-SHDR dependencies are deduced as much as possible.

The downside is that while the output should still work just fine, 'make
check' fails to establish binary equivalence of input and output if the
section table is reordered. Thankfully, in normal GCC binaries it is
already ordered so we don't have to worry about this.

Unfortunately the ELF spec is very lax in this regard so we have to draw
a line ourselves.