Create ObjectFile with C bindings


I've been studying the LLVM C bindings (include/llvm-c/) and it 's not very clear to me how I could create an ELF object file with them.

Function "LLVMCreateObjectFile" (in Object.h) needs an "LLVMMemoryBufferRef" object but I'm not sure how I should create one using the created "LLVMModuleRef".

The reason why I want to use the C bindings and not the C++ interface is because I use them through some Erlang NIFs [1]. I apologize if it's something obvious that I'm missing!