Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12610 Discussions

gp addressing used despite G0 flag

Altera_Forum
Honored Contributor II
949 Views

This is my situation: 

 

an application of mine showed very strange behavior. After a few days working through the disassembled code, I found out that some functions provided by the projects syslib were using gp relative addressing with an offset of -32768. Even though this is a legal value it seems as if it was used by default, because using the G0 flag also with the projects system library solved most of the problems. 

Unfortunately, there are still some functions not working properly, like printf. 

 

I found out that __vfprintf_internal is still using gp relative addressing with an offset of -32768! 

I could not find the source code for this function, but I fear that it is assembler and using the %gprel macro. 

Any ideas on this issue? 

 

--Wolf
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
268 Views

Are the libraries recompiled also with the G0 option? 

 

 

 

Stefaan
0 Kudos
Reply