Page 1 of 1

weird linking bug

Posted: Fri Feb 08, 2008 10:54 am
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

Posted: Fri Feb 08, 2008 11:00 am
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?

Posted: Fri Feb 08, 2008 11:29 am
by suthers
Thanks that fixed it.
That was kind of stupid :oops:
Jules