public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* use $gp with mips platform
@ 2001-12-19 22:43 Yaroze
  0 siblings, 0 replies; only message in thread
From: Yaroze @ 2001-12-19 22:43 UTC (permalink / raw)
  To: gcc-help

Hello Everyone,

I am trying to optimize a program running on an embedded MIPS platform.
When I try to use $gp (global pointer) register to reduce the
instruction numbers to access global variables, linker ld refuses to
operate correctly. The program get compiled and linked fine with "-G
0"(turn off $gp optimization), but failed with "-G 8". The linker
gives a message of "relocation truncated to fit: R_MIPS_GPREL16 no
symbol" at each location using global variable.
Can anyone tell me how to solve this problem? I appreciate your help
very much.
And since the program includes boot code, I need to initialize $gp
with a given symbol by the linker. I tried with "la $gp,_gp", but
linker said it was an undefined symbol. So how should I initialize
$gp?


 Alex                          mailto:Yaroze@21cn.com


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-12-20  6:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-19 22:43 use $gp with mips platform Yaroze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).