ELF would be the way to go, perhaps overkill, but the tools generate it and it is well documented.
You should probably look at the linker (and the directive file) rather than the compiler. The objects emitted by the compiler are relocatable ELF objects. You might look at the --emit-relocs option to keep them.
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..