Re: Profiling+nested functions+dynamic linking on IA-64/Linux

2005-10-24 Thread Eric Botcazou
> 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. Ah! yes, of course, writing the stub by hand. This c

Re: Profiling+nested functions+dynamic linking on IA-64/Linux

2005-10-24 Thread Richard Henderson
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->

Profiling+nested functions+dynamic linking on IA-64/Linux

2005-10-24 Thread Eric Botcazou
Hi, As the title may hint at, the combination doesn't work because: 1. the static chain register is r15 and 2. mcount is called from the prologue and 3. r15 is correctly preserved in glibc/sysdeps/ia64/_mcount.S but 4. r15 is clobbered in the PLT: 5.3.6 Procedure Linkage Table 2.