From mboxrd@z Thu Jan 1 00:00:00 1970 From: Doug Evans To: "Russ.Shaw" Cc: crossgcc@sourceware.cygnus.com Subject: Re: Library and linker errors Date: Wed, 02 Aug 2000 09:57:00 -0000 Message-id: <14728.21198.544259.617989@casey.transmeta.com> References: <001101c01fe1$7e10b260$58210b0a@huawei.com.cn> <3987B6DA.61538FBF@webaxs.net> <14727.47860.955266.603288@casey.transmeta.com> <3987EA19.B794F54B@webaxs.net> X-SW-Source: 2000-08/msg00009.html 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