Problems linking on PPC

Daniel Jacobowitz drow@mvista.com
Wed Jan 15 17:08:00 GMT 2003


On Wed, Jan 15, 2003 at 06:04:08PM +0100, Jacob Gorm Hansen wrote:
> Hi,
> 
> I am trying to create a cross-compiler setup for the Nintendo Gamecube
> (powerpc 750 'Gekko') on i386 Linux. I've compiled my own GCC 3.2 and
> binutils 2.12.
> 
> Nintendo have provided me with static libraries, one of them containing
> a weak symbol __start. I have a linker script which asks for
> ENTRY(__start), but when I link my hello world app with this lib as in:
> 
> $ powerpc-linux-ld -T linker.ld ib.o os.a
> 
> I get:
> powerpc-linux-ld: warning: cannot find entry symbol __start; defaulting
> to 00000040
> powerpc-linux-ld: a.out: Not enough room for program headers, try
> linking with -N
> powerpc-linux-ld: final link failed: Bad value
> 
> 
> or:
> 
> $ powerpc-linux-ld -e __start ib.o os.a 
> powerpc-linux-ld: warning: cannot find entry symbol __start; defaulting
> to 10000074
> 
> $ nm os.a |grep __start
> __start.o:
> 00000040 W __start
> 
> 
> $ e$ objdump -d os.a |grep __start
> __start.o:     file format elf32-powerpc
> 00000040 <__start>:
>   40:  (lots of code which I cannot show you due to my NDA).
> 
> 
> My understanding is that this symbol should be included, even though it
> is weak, is that correct? Can I force its inclusion somehow? Can the
> problem be that os.a has probably been compiled with gcc2.95?
> 
> Any help would be appreciated.

Try using --whole-archive os.a --no-whole-archive.  Otherwise only
referenced archive members are included, and -e doesn't count as a
"reference".

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Binutils mailing list