Help with linker

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
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Help with linker

Post by deleted »

Hello, I am new to this site, and have been developing an operating system. My problem: I can't use regular ld command with argument -T.

I have googled for a long time but with no results. Here is my specs:

* Developing on: Macbook, while 2010, Xcode 3.2, with i686-pc-elf toolchain installed.

Any help would be awesome. Thanks!!

-- wxwsk8er
Last edited by deleted on Wed Jul 23, 2014 3:49 pm, edited 1 time in total.
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

Re: Help with linker

Post by zhiayang »

You cannot use OS X's 'ld' tool to link.
Make a GCC Cross Compiler, then use the LD from your i686-elf-pc-ld to link.
User avatar
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Re: Help with linker

Post by deleted »

requimrar wrote:You cannot use OS X's 'ld' tool to link.
Make a GCC Cross Compiler, then use the LD from your i686-elf-pc-ld to link.
When do this:

Code: Select all

walt-pachs-macbook:~ Walt$ /usr/i686-pc-elf/bin/ld -T
  /usr/i686-pc-elf/bin/ld: unrecognized option '-T'
  /usr/i686-pc-elf/bin/ld: use the --help option for usage information
When I use it directly:

Code: Select all

walt-pachs-macbook:~ Walt$ i686-pc-elf-ld -T
  i686-pc-elf-ld: unrecognized option '-T'
  i686-pc-elf-ld: use the --help option for usage information
When I use ld.gold:

Code: Select all

walt-pachs-macbook:~ Walt$ /usr/i686-pc-elf/bin/ld.gold -T
  /usr/i686-pc-elf/bin/ld.gold: -T: missing argument
  /usr/i686-pc-elf/bin/ld.gold: use the --help option for usage information
So ld.gold works fine, but the rest do not. Unless I call gcc and ask for a linkage...

Thanks for the help :D
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Help with linker

Post by Combuster »

I have a nagging suspicion that none of those cross-linkers were built according to the tutorial though.
"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 ]
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Help with linker

Post by jnc100 »

Even my cross compiler gives this error when run with the -T option and no linker script name specified:

Code: Select all

$ i586-elf-ld -T
i586-elf-ld: unrecognized option '-T'
i586-elf-ld: use the --help option for usage information
You also have to specify a linker script file.

Regards,
John.
User avatar
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Re: Help with linker

Post by deleted »

I downloaded the binarys, but I will try what you said. With the option and let you know how it works :D thanks!!
User avatar
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Re: Help with linker

Post by deleted »

It worked!!

Thanks for all your help!!
Post Reply