Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coldfire-gnu-discuss] CS3 Startup Process - Specifying A Different Vector Table


  • To: Daniel McLean <daniel.mclean@xxxxxxxxxxxxxxx>
  • Subject: Re: [coldfire-gnu-discuss] CS3 Startup Process - Specifying A Different Vector Table
  • From: Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
  • Date: Fri, 18 Apr 2008 17:07:39 -0700

Daniel McLean wrote:

However when I use the same vector file in a managed make project (eg. the
factorial example from the Getting Started Guide).  I have no problems.  The
difference I assume is because managed make uses gcc to build the elf file
from a collection of object files, and my problem is arising because I want
to use ld to link the files together, and some files are coming out of
archives?

Yes, using ld to link directly is rather tricky. We always recommend that users use gcc to link, instead of ld, because gcc knows what options to pass for libraries and such. You can still pass options to the linker with "-Wl"; for example:

  gcc -Wl,-map,map.txt file.o -o program.exe

passes along the "-map" option to the linker.

Is there a reason that you need to use "ld"?

What am I doing wrong, and why is ld even looking for the vector table when
I've already got it defined?

It's possible that something is requiring some symbol defined in coldfire-vector.o (from libcs3coldfire.a) and therefore the linker is pulling that in, even though you've already got a definition. You could probably see if that's the case by looking at the mapfile. (See options above.)

Thanks,

--
Mark Mitchell
CodeSourcery
mark@xxxxxxxxxxxxxxxx
(650) 331-3385 x713