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.
I have a problem with ld (or may be gcc) . I have about 30 files in my kernel. I compile all, then link groups into object files using the '--relocatable' switch of ld. Then at the end i link all the object files of the groups.
e.g.:
ld -T (linkscript) -o image res1.o res2.o
ld --relocatable -o res1.o fdc.o hd.o
ld --relocatable -o res2.o lpt.o ser.o
While linking the whole kernel at the end i get an error from ld that it found multiple definitions of symbol "__environ" which i never declared in any of my files.
It is found in one or two of my source files which are not different than others in any way that could cause such a problem
salil_bhagurkar wrote:I am unaware of that term 'dependencies'. Do you mean i included some unwanted headers or declared protorypes of functions that do not exist?
Possibly linking with a library from your development system? could be possibly including a system header.. (Why?.)..
I can't be sure..
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
I am surely not linking with any system library or including a system header. I thought giving a switch '-ffreestanding' would help (i referred gcc man) but even that made no difference...
salil_bhagurkar wrote:I am surely not linking with any system library or including a system header. I thought giving a switch '-ffreestanding' would help (i referred gcc man) but even that made no difference...
What are the commands do you use to build your kernel?
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Is your kernel Open Source? maybe someone else can track it down for you.. if not.. manually going through your source with the grep command would be recommended..
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
A GCC Cross-Compiler is recommended practice. If your kernel wont link properly, then the barebones might suffer the same problem...
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]