Currently only -m *_fbsd and -m msp430elf explicitly specifiy the OSABI
field, all others set the value to zero.
FreeBSD expects the OSABI field to be set for all executables, but both
GCC and Clang pass -melf64lriscv to the linker. This causes all RISC-V
executables to have a SysV OSABI which confuses tools such as ldd.
This patch changes the behaviour to infer the OSABI from the first input
.o file for -m options that don't encode a specific OSABI.