A patch to stop the use of the “--whole-archive” argument causing a crash if an archive contains non-elf files.
Details
This code change and test originates from a patch by rafael.
Using the argument “--whole-archive” forces the load of all members in a static library, however the link fails if the archive contains any other kinds of file. This patch means these files are instead skipped over.