Using std::list Linker Error

support for the powerpc toolchain
Post Reply
71M
Posts: 2
Joined: Tue Jun 10, 2008 9:15 pm

Using std::list Linker Error

Post by 71M » Tue Jun 10, 2008 10:41 pm

Hi,
I'm relatively new to the Wii homebrew scene and was wondering if anyone could tell me what this linker error means?

Code: Select all

3>c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.3/../../../../powerpc-gekko/bin/ld.exe: ../../../../lib/wii\libcp.a(CRenderable.o): the target (__dso_handle) of a R_PPC_EMB_SDA21 relocation is in the wrong output section (.data)
I can fix the error by commenting out the std::list in the code but that's obviously not desirable! :)
One other thing I forgot to mention is that the std:list is defined in a custom library so I guess it's something to do with that maybe?

Cheers,
71M

71M
Posts: 2
Joined: Tue Jun 10, 2008 9:15 pm

Re: Using std::list Linker Error

Post by 71M » Thu Jun 12, 2008 10:13 pm

Ok, I finally got this to link by removing the flag -msdata=eabi from the makefile.
That'll teach me for copying makefile settings from other projects without fully understanding it!

Out of interest what does this flag do?

Cheers,
71M

WinterMute
Site Admin
Posts: 1986
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Using std::list Linker Error

Post by WinterMute » Tue Jun 24, 2008 3:51 pm

Hi Tim,

Good to see you here, been meaning to drop you a mail to say hello since I saw the comment on the main site, poke me if I don't - I'm terrible for not getting around to things.

To answer your question, the -msdata=eabi option places small initialised global const data in the sdata2 section, non const data in sdata which are then accessed using register relative adressing from r2/r13. It's supposed to produce smaller faster code.

Unfortunately I'm not quite sure what triggers this, some opinions are that it's broken behaviour in binutils and other sources say it's related to a wrong -G option when compiling. It's possible that the way I'm building gcc isn't quite right - it's yet another thing on the todo list but I can't seem to reproduce it consistently with a small enough testcase to work with.

If you have the time and the inclination to try and reproduce it with a relatively small project then do feel free to file a bug report and attach some code.

You'll find the powerpc specific switches at http://gcc.gnu.org/onlinedocs/gcc-4.2.4 ... PC-Options which goes into a little more detail on what the options do.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest