This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Handling of -fpic in ASM_OUTPUT_MI_THUNK in sparc
- To: tot at trema dot com (Teemu Torma)
- Subject: Re: Handling of -fpic in ASM_OUTPUT_MI_THUNK in sparc
- From: Jason Merrill <jason at cygnus dot com>
- Date: 18 Nov 1997 09:33:45 -0800
- Cc: egcs at cygnus dot com
- References: <199711181604.RAA19200.cygnus.egcs@lev.labs.trema.com>
>>>>> Teemu Torma <tot@trema.com> writes:
> It seems that ASM_OUTPUT_MI_THUNK in sparc emits normal funcion call
> sequence when the file compiled is compiled with -fpic. This sounds
> very slow, since the call goes thru the dynamic table and can lead to
> an additional register window trap.
It uses a normal function call because that's the only way to get the
appropriate relocs for PIC code. There is no jmp that uses the procedure
linkage table.
> Is there any reason why not to emit the thunk to a writable segment?
> In that case -fpic condition could be taken away.
I suppose, but I can't imagine that a function call is as slow as all that.
> Besides, the current test does not help if the main program compiled
> without -fpic emits thunks that call methods in a shared library.
Huh? How is this different from any other function that calls functions in
a shared library?
Jason