-G0 option

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
gauri
Posts: 35
Joined: Sun Jan 20, 2008 11:17 pm
Location: Belarus

-G0 option

Post by gauri »

What is the reason for -G0 to be used? It seems that without this option the programs compile to much smaller code.
Freelance game industry veteran. 8]
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

The decision of which variables to put in the GP-relative small data section happens at compile time. When you link multiple object files, on larger projects with MIPS you often find that there were too many of them, and the linker can't do anything about it at that point (gives GPREL relocation errors). So compiling with -G0 is usually done to just avoid those kinds of problems. If you can increase the value without triggering errors then yeah, that's good.
Post Reply