This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Profiling+nested functions+dynamic linking on IA-64/Linux
- From: Richard Henderson <rth at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 24 Oct 2005 11:23:52 -0700
- Subject: Re: Profiling+nested functions+dynamic linking on IA-64/Linux
- References: <200510241737.06671.ebotcazou@adacore.com>
On Mon, Oct 24, 2005 at 05:37:06PM +0200, Eric Botcazou wrote:
> Would that be fixable purely on the compiler side without too much kludgery?
Yes. Instead of a direct call, load the fptr for _mcount and do an
indirect call. That'll avoid the dynamic linker. You can conditionalize
this on cfun->static_chain_decl to avoid the extra work when nested
functions aren't involved.
Also, technically fptrs (and thus dynamic linking) isn't used when either
TARGET_NO_PIC or TARGET_AUTO_PIC are set. Of course, I wouldn't expect
nested functions to be used here either, but...
r~