Page 1 of 1
Object file formats
Posted: Thu Jul 07, 2005 11:00 pm
by yetAnotherOS
A while back I was compiling a library using borland's compiler. It creates .OBJ files. Now, I'd like to include some of those library object files in my OS but I can't get any of my ports of gnu binutils to use them. I have mingw and djgpp. Any ideas?
Re: Object file formats
Posted: Thu Jul 07, 2005 11:00 pm
by rexlunae
yetAnotherOS wrote:A while back I was compiling a library using borland's compiler. It creates .OBJ files. Now, I'd like to include some of those library object files in my OS but I can't get any of my ports of gnu binutils to use them. I have mingw and djgpp. Any ideas?
Yes. Recompile the old files with the compilers/tools you are currently using.
Re: Object file formats
Posted: Fri Jul 08, 2005 11:00 pm
by yetAnotherOS
Unfortunately, slight language differences prevent me from using GNU compilers for the old code. I have noticed that NASM supports the 16/32 bit OMF .obj format but it seems that the GNU tools do not.
Re: Object file formats
Posted: Sat Jul 09, 2005 11:00 pm
by Legend
Can't you port those libraries to the gnu tools then? Or do you have to use them unmodified?
Re: Object file formats
Posted: Sat Jul 09, 2005 11:00 pm
by rexlunae
yetAnotherOS wrote:Unfortunately, slight language differences prevent me from using GNU compilers for the old code.
If the differences are only slight, I stil think the easiest solution is to modify the code to work with the GNU tools. If you don't, the build process will be convoluted. Ugh!
yetAnotherOS wrote:I have noticed that NASM supports the 16/32 bit OMF .obj format but it seems that the GNU tools do not.
True, but you can use the gcc tools to output code that runs in 16-bit mode with the .bits16gcc assembler directive. I don't really know what you are trying to accomplish, but I am having a hard time envisioning a scenario where it makes sense to link together code created by multiple different C compilers in different object formats.
Re: Object file formats
Posted: Sat Jul 09, 2005 11:00 pm
by yetAnotherOS
My situation is not as farfetch as I have mistakenly suggested. What I have are standard VGA graphics routines that I developed several years ago and would like to include in the OS I am working on now. I am keeping everything for the OS in elf object format and making the final binary in the flat binary format. I just hoped that there was a way to avoid having to recode too much, but I guess I am not in luck.
Thanks for the help anyways.