[coldfire-gnu-discuss] CS3 Startup Process - Specifying A Different Vector Table
Mark Mitchell
mark at codesourcery.com
Sat Apr 19 00:07:39 UTC 2008
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 at codesourcery.com
(650) 331-3385 x713
More information about the coldfire-gnu-discuss
mailing list