New executable format

So I was wondering how one would go about adding a new target format. I can't
find any documentation on the matter. I want to create my own much
simplified executable format for a simple OS but I definitely don't wan't to
re-implement a compiler and I really want the powerful optimizations that
LLVM is already capable of. How would it be possible to do this so that
after all my items are linked together I have the output format I desire?
The linker doesn't strictly need to accept this format as input but it does
need to be able to produce it as output.

I have looked at the class TargetLoweringObjectFile but I'm really not sure
what to do with it.