I need to generate some simple obj/o file that would contain my binary procedure body (I need to write some very simple partial assembler)
I need to generate such obj binary that i could use with some linker to link and run this my procedure. I wonder 1) what would be the easiest obj format (I need something that i could link finaly with gcc but if somethink is easier there are as far as i know some tools to convert one obj format to another so i could use thic converter) 2) I wonder what this code generating this obj context would look like - assume that i have binary asm contents to flush into but i need only make the obj "envelope" around it
I even not necessarely need to flush more procedures than one (only one would suffice, in such case i could generate seperate obj for each procedure) but i would like also some code to embedd my exported procedure symbol name and also to embedd names of imported symbols (though it is maybe also not so critical, as i could pass them by arguments_ I m mainly interested for extremal simplicity that would allow me to run this
assume that i have say such data to flush
const int procedure_binary_body_max = 130;
char procedure_binary_body[procedure_binary_body_max]; //130 bytes of procedure body
char* procedure_symbol_name = "sse_dot";
and i need some code to make and save this as an obj file to disk that i could link it with gcc
could someone help with that? very much tnx