Problems linking on PPC

Jacob Gorm Hansen
Wed Jan 15 17:04:00 GMT 2003


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


$ 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
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.


More information about the Binutils mailing list