Author |
Message |
Michael
Joined: Sat Jul 25, 2009 6:10 am Posts: 112 Location: United Kingdom
|
*.o not recongised: file format not recognised
I seem to get this while compiling my Operating System (when linking kernel_start.o). I think it's the ld software, because it happens with many different examples over the net. Any ideas?
_________________ Thanks, Michael Sammels
OS Developing is 10% luck, 20% skill, 15% concentrated power of will. 5% pleasure, 50% pain, and a 100% reason continue the game.
|
Sun Oct 25, 2009 1:35 pm |
|
|
ctimko
Joined: Wed Oct 14, 2009 9:39 am Posts: 198 Location: United States
|
Re: *.o not recongised: file format not recognised
What is the format you are using? ELF or PE/COFF
_________________ Charles Timko push %esp ;Musings of a computer addict
|
Sun Oct 25, 2009 7:07 pm |
|
|
Love4Boobies
Joined: Sat Jul 25, 2009 11:26 am Posts: 81
|
Re: *.o not recongised: file format not recognised
".o" is not a format, rather a file extension.
Cheers, Bogdan
|
Mon Oct 26, 2009 12:13 am |
|
|
Kieran
Site Admin
Joined: Sat Jul 25, 2009 7:44 am Posts: 274 Location: United Kingdom
|
Re: *.o not recongised: file format not recognised
Bogdan, the *.o file type, is a file format, but it is a format that contains an intermediate object, which is usually linked to form a complete program.
What is the command line you are using to compile the *.o files? Also, what is the platform you are compiling/linking on?
_________________ Thank you for reading,
Kieran C G Foot
|
Mon Oct 26, 2009 3:41 am |
|
|
Love4Boobies
Joined: Sat Jul 25, 2009 11:26 am Posts: 81
|
Re: *.o not recongised: file format not recognised
Nope, it's just an extension. It can be used with any format from a.out to ELF and COFF.
Cheers, Bogdan
|
Mon Oct 26, 2009 4:31 am |
|
|
Kieran
Site Admin
Joined: Sat Jul 25, 2009 7:44 am Posts: 274 Location: United Kingdom
|
Re: *.o not recongised: file format not recognised
Yes, exactly, the .o on the end of the file just denotes the fact that the file contains object data, regardless of its internal format.
_________________ Thank you for reading,
Kieran C G Foot
|
Mon Oct 26, 2009 5:02 am |
|
|
Love4Boobies
Joined: Sat Jul 25, 2009 11:26 am Posts: 81
|
Re: *.o not recongised: file format not recognised
Exactly. I wanted to clarify this because if the error spat by the linker is anything like the one in the thread title then I suspect the OP didn't make this difference and passed "*.o" as the format instead of say, ELF. I've seen people do this before; just making sure it's not the case.
Cheers, Bogdan
|
Mon Oct 26, 2009 7:37 am |
|
|
Michael
Joined: Sat Jul 25, 2009 6:10 am Posts: 112 Location: United Kingdom
|
Re: *.o not recongised: file format not recognised
Please stop arguing about the way I code please. Code: gcc -c -nostartfiles -nostdlib -nostdinc -I ../include ../kernel/main.c -o kernel.o nasm -f aout ../kernel/start.asm -o start.o ld -T link.ld -o kernel.sys start.o kernel.o
_________________ Thanks, Michael Sammels
OS Developing is 10% luck, 20% skill, 15% concentrated power of will. 5% pleasure, 50% pain, and a 100% reason continue the game.
|
Mon Oct 26, 2009 11:50 am |
|
|
Love4Boobies
Joined: Sat Jul 25, 2009 11:26 am Posts: 81
|
Re: *.o not recongised: file format not recognised
We weren't arguing. What was GCC configured for? If it was configured for ELF then you're trying to link an a.out with an ELF which will never work. Also, "-nostartfiles" means "-nostdlib" + "-nostdinc".
Cheers, Bogdan
|
Mon Oct 26, 2009 8:43 pm |
|
|
Kieran
Site Admin
Joined: Sat Jul 25, 2009 7:44 am Posts: 274 Location: United Kingdom
|
Re: *.o not recongised: file format not recognised
Hmm, you know I didnt think of that Bogdan.
Michael mate, build a cross-compiler for your platform, do both GCC and BinUtils so you know they will work together, there is a tutorial on OSDev.org on how to do this.
I used to have this same problem when I used DJGPP, but the actual error was a bit more obscure then yours, but it boiled down to the same problem.
_________________ Thank you for reading,
Kieran C G Foot
|
Tue Oct 27, 2009 4:54 am |
|
|