This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A very "strange" bug in gcc 2.96
Mark Mitchell <mark@codesourcery.com> writes:
>
> H> without -fPIC. With "jmp foo", it doesn't work anymore. If it
> H> is intentional, we should declare PIC is required for building
> H> shared libraries.
>
> I think that using -fPIC should be required for building shared
> libraries.
Some x86 people prefer not to use -fPIC for all shared library functions:
it costs you a few duplicated code pages, but gives you a valuable register
which can make a big difference in a important inner loop. Making gcc more
clever about pic register handling could have the same effect, but currently
using -fPIC means that you lost the register in a function if at least
one global symbol is accessed.
-Andi