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
>>>>> "Andi" == Andi Kleen <ak@suse.de> writes:
Andi> 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.
Andi> Some x86 people prefer not to use -fPIC for all shared
Andi> library functions: it costs you a few duplicated code pages,
Andi> but gives you a valuable register which can make a big
Andi> difference in a important inner loop. Making gcc more clever
Andi> about pic register handling could have the same effect, but
Andi> currently using -fPIC means that you lost the register in a
Andi> function if at least one global symbol is accessed.
That's a good point. But, it's really a good argument for improving
the copmiler -- not for not requiring -fPIC for shared objects.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com