This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Library and linker errors


Russ.Shaw writes:
 > I used ld separately
 > so that i could use the linker script to specify where the
 > eproms are etc.
 > 
 > This cross-gcc is the first time i've used gcc, and i didn't
 > know how to adapt the output memory map to my system. If gcc
 > can interpret a linker script, maybe i can make some changes...

To clarify something, when you use gcc to do the link
you really are using ld to do the link.  The difference
is that gcc's knows (and should know) more about the installation
than ld and can pass the appropriate arguments to ld.

To see this in action, try using gcc to do the link but add an
additional -v argument.  You will see how gcc is invoking ld.

Pass -mh when you do the link (just as you did when you compiled
your C files) and you will see gcc telling ld to use the files
in /usr/local/h8300-hms/lib/h8300h and not those in
/usr/local/h8300-hms/lib.

When you build an h8300 toolchain,
by default you get support for BOTH the h8/300 (16 bit)
and h8/300h (32 bit).  It's the -mh argument that tells gcc
to compile for the h8/300h and it's also the -mh argument that
tells gcc to tell ld where to find the libraries compiled for
the h8/300h.

 > I am compiling with -mh for the H8/300H option.  The problem of
 > having H8/300 library files in /usr/local/h8300-hms/lib was the
 > cause of my last heap of errors!

Ah hah! :-)

 > I fixed that by copying the
 > files from /usr/local/h8300-hms/lib/h8300h into this directory.
 > I'll see if i can make h8300-hms-gcc do this in an automated
 > way.

Do things as you see best, but I recommend against this.

 > Also, for ones own custom hardware, are these linker scripts
 > supposed to be of any use?:
 > 
 > /usr/local/h8300-hms/lib/ldscripts/h8300h.x
 >                                    h8300h.xbn
 >                                    h8300h.xn
 >                                    h8300h.xr
 >                                    h8300h.xu

Nope.  These are simple linker scripts to begin from.
IIRC, they're for simple programs you want to run on the
GNU h8/300h simulator, but that's it (pretty much).

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]