MIPS, libsupc++ and -G 0

Jonathan Larmour jifl@eCosCentric.com
Mon Apr 18 20:47:00 GMT 2005


On MIPS, libgcc is built with -G 0, which is used to ensure the contents 
don't assume they will be placed in the small data/bss section. Setting -G 
0 is used to allow for the possibility of large applications, or those 
where even small data may be located more than 64k away from the gp pointer.

However this is not done with libsupc++ or libstdc++. The result is that 
for some of my embedded applications, which require -G 0 themselves, 
"stderr" is far away from the gp pointer. This shouldn't matter except 
that vterminate.cc in libsupc++ was not compiled with -G 0 and thus is 
expecting to be able to use a 16-bit gp relative relocation, thus we get a 
link failure.

Was this a conscious decision or an accident? Is the best route for me to 
just add -G 0 for all mips libstdc++/libsupc++, and submit that as a patch?

Thanks in advance,

Jifl
-- 
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine



More information about the Gcc mailing list