Brynet-Inc wrote:
As for the other thing.. you could try -fomit-frame-pointer.
Perhaps you should read GCC's documentation?
Thanks.
bluecode wrote:That would normally be the job of a linker. You have to pass some of LDs options as a command-line argument for GCC (I don't know how that works though).
Or you could compile/assemble your files independent into object code and then link them together explicitly with LD.
So I will write the program and then compile it into an object file then link it together with my other object files and produce the final flat binary file eh?
bluecode wrote:I don't really understand that... Why not just declare SomeProcedure extern in your assembler file and then do "call SomeProcedure" (be carefull, perhaps the name got mangled, nm/objdump will tell ya)?
For example, in NASM; when I write a procedure/function at the top of the source code, I will be sure that the first instruction in that procedure is the first assembled instruction in the binary file. So if I load that file into memory in my OS and CALL the offset 0x00000000 in that file, I would know that the first procedure is called. Is that possible in C or should I create jump tables and etc?
The reason I want to do this is to, for example, write a device driver for mice and then load that dynamically in my Operating System. I want the "init()" method of any device driver to start at the first instruction in the flat binary file.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.