weird linking bug

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

weird linking bug

Post by suthers »

This is the batch file i use for linking, assembling and compiling:

Code: Select all

"C:\My OS\nasm-0.98.35-win32\nasm.exe" -o "C:\My OS\SOS\bootloader.o" "C:\My OS\SOS\bootloader.asm" -f bin 
"C:\Dev-Cpp\bin\gcc.exe" "C:\My OS\SOS\kernel.c" -o "C:\My OS\SOS\kernel.o" -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -c 
"C:\My OS\nasm-0.98.35-win32\nasm.exe" -o "C:\My OS\SOS\main_init.o" "C:\My OS\SOS\main_init.asm" -f aout 
"C:\My OS\elfbinutils2112\ld.exe" -T "C:\My OS\SOS\link.ld" -o "C:\My OS\SOS\kernel.o" "C:\My OS\SOS\kernel.o" "C:\My OS\SOS\main_init.o"
PAUSE
it works fine until the linking which says:
kernel.o: file not recognized: file truncated.
Kernel.c compiles fine and kernel.o is formed, but ld deletes it.
Any ideas why this happens
Thanks in advance,

Jules
StephanvanSchaik
Member
Member
Posts: 127
Joined: Sat Sep 29, 2007 5:43 pm
Location: Amsterdam, The Netherlands

Post by StephanvanSchaik »

"C:\My OS\nasm-0.98.35-win32\nasm.exe" -o "C:\My OS\SOS\bootloader.o" "C:\My OS\SOS\bootloader.asm" -f bin
"C:\Dev-Cpp\bin\gcc.exe" "C:\My OS\SOS\kernel.c" -o "C:\My OS\SOS\kernel.o" -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -c
"C:\My OS\nasm-0.98.35-win32\nasm.exe" -o "C:\My OS\SOS\main_init.o" "C:\My OS\SOS\main_init.asm" -f aout
"C:\My OS\elfbinutils2112\ld.exe" -T "C:\My OS\SOS\link.ld" -o "C:\My OS\SOS\kernel.o" "C:\My OS\SOS\kernel.o" "C:\My OS\SOS\main_init.o"
PAUSE
Why is it specified twice?
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Post by suthers »

Thanks that fixed it.
That was kind of stupid :oops:
Jules
Post Reply