Respect the entry size in ELF linking.

Hopefully fixes #1862.
Merge pull request #1872 from unknownbrackets/elf-fix

Respect the entry size in ELF linking