This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -G 0 for mips and ppc



Mike Stump <mrs@wrs.com> writes:

> We go out of our way to build up libraries with -G 0 for gcc
> (libgcc.a), but the other run time libraries (C++, libiberty and so
> on) don't get the -G 0 flag.  Not sure if this is really a problem or
> not.  I had to change my default for -G to be 0, as our os doesn't
> support it yet.

You have to _not_ use -G if the library in question is static and
define global variables, otherwise linking with it won't work.

For shared libraries, it's pretty much irrelevant on ppc at least
because -G isn't supported for them yet and the option only applies
internally to the library anyway.

Finally, it's nice to have -G0 for static libraries that don't define
global variables to keep local static variables out of .sdata
(although really gcc should handle this itself).  If it was a problem,
you could delete the flag.

-G0 is only _necessary_ for crt*.o because they hack around with the
assembler output and get confused.

-- 
Geoffrey Keating <geoffk@cygnus.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]