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. The relocation index for the function being called must be placed into
    GR 15 so that the dynamic linker can identify the target of the call.
    This value is an index into the portion of the dynamic relocation table
    addressed by the DT_JMPREL dynamic section entry. The designated
    relocation entry will have type R_IA_64_IPLTMSB or R_IA_64_IPLTLSB,
    and its offset will specify the local function descriptor entry referenced
    by the call.

Would that be fixable purely on the compiler side without too much kludgery?
My understanding is that the way _mcount_ret_helper is written in glibc (in 
particular the 'alloc' line) is quite annoying.  Or is that a lost cause and 
should profiling require static linking in presence of nested functions?

Thanks in advance.

-- 
Eric Botcazou

Reply via email to