https://sourceware.org/bugzilla/show_bug.cgi?id=32768

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Alan Modra from comment #0)

> Disassembly of f1 and f2 shows the expected calls are there, it's just
> that gprof miscategorises the f2->f1 call as f1->f1.
> 
> 0000000000401196 <f1>:
>   401196:       55                      push   %rbp
>   401197:       48 89 e5                mov    %rsp,%rbp
>   40119a:       e8 b1 fe ff ff          call   401050 <mcount@plt>
>   40119f:       5d                      pop    %rbp
>   4011a0:       c3                      ret
> 
> 00000000004011a1 <f2>:
>   4011a1:       55                      push   %rbp
>   4011a2:       48 89 e5                mov    %rsp,%rbp
>   4011a5:       e8 a6 fe ff ff          call   401050 <mcount@plt>
>   4011aa:       e8 e7 ff ff ff          call   401196 <f1>
>   4011af:       5d                      pop    %rbp
>   4011b0:       c3                      ret
> 

My binary has different alignment:

0000000000400500 <f1>:
  400500:       55                      push   %rbp
  400501:       48 89 e5                mov    %rsp,%rbp
  400504:       e8 87 fe ff ff          call   400390 <mcount@plt>
  400509:       5d                      pop    %rbp
  40050a:       c3                      ret
  40050b:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)

0000000000400510 <f2>:
  400510:       55                      push   %rbp
  400511:       48 89 e5                mov    %rsp,%rbp
  400514:       e8 77 fe ff ff          call   400390 <mcount@plt>
  400519:       e8 e2 ff ff ff          call   400500 <f1>
  40051e:       5d                      pop    %rbp
  40051f:       c3                      ret

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to