Linking help
-
- Member
- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
Linking help
Apologies for the many questions. Yes, I've tried google, couldn't seen to find what i'm looking for. I'm following JamesM's Tut. Using windows with Cyg. I Have boot.o and main.o, how do i link them, i have the link.ld linker script file, but i don't understand how to link them. I looked to ld --help, but couldnt figure out how to use link.ld to link the two into "kernel".
thanks
thanks
If bill gates had a dollar for everytime windows crashed...oh wait... he does.
-
- Member
- Posts: 368
- Joined: Sun Sep 23, 2007 4:52 am
Have you tried something like this?
where link.ld is your linker script, kernel.prg is the output file and the rest is a list of input files?
(By the way, unless you know what you're doing without it, you should build a cross compiler and linker, see the wiki for instructions.)
Code: Select all
ld -T link.ld -o kernel.prg main.o
(By the way, unless you know what you're doing without it, you should build a cross compiler and linker, see the wiki for instructions.)
-
- Member
- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
-
- Member
- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
hmm. i try:
and
and for both it says:
"cannot open linker script file - No such file or directoy
Code: Select all
ld -T C:\Link.ld
Code: Select all
ld -T C:/Limk.ld
"cannot open linker script file - No such file or directoy
If bill gates had a dollar for everytime windows crashed...oh wait... he does.
-
- Member
- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
-
- Member
- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
-
- Member
- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
-
- Member
- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
-
- Member
- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
Nah, windows is just like that lol...Brynet-Inc wrote:I'm no Windows guru, but the solution seems rather obvious... you accidentally named the file "Link.ld.txt" instead of "Link.ld".
Perhaps OSDev is a little bit out of your league...
I don't know what to say... I have my linker script in my kernel's directory, no problem there. Just move the linker script to where the rest of your files are