This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -G 0 for mips and ppc
- To: Mike Stump <mrs at wrs dot com>
- Subject: Re: -G 0 for mips and ppc
- From: Geoff Keating <geoffk at ozemail dot com dot au>
- Date: 03 Sep 1999 14:09:37 +1000
- CC: gcc-bugs at gcc dot gnu dot org
- References: <199909030046.RAA05396@kankakee.wrs.com>
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>