0

When I run Callgrind on a simple program on an ARMv7 system, I get the following dump (extract):

ob=(6) /lib/arm-linux-gnueabihf/libm-2.31.so
fl=(68) ./csu/../sysdeps/arm/crti.S
fn=(280) 0x00007570
0x7570 64 1
0x7574 65 1
0x7578 67 1
0x757c 68 1
0x7580 69 1
0x7584 70 1

fl=(114) ./math/../sysdeps/arm/e_sqrt.c
fn=(914) __sqrt_finite@GLIBC_2.15
0x143bd 36 10000
0x143c1 43 10000

fl=(113) ./math/w_sqrt_compat.c
fn=(912) sqrt
0x84e9 31 10000
0x84ed 30 10000
0x84ef 30 10000
0x84f3 30 10000
0x84f5 31 10000
0x84f9 31 10000
0x84fb 34 10000
0x84ff 34 10000
cfi=(114)
cfn=(914)
calls=10000 0x143bd 36 
0x84ff 34 20000

And when I run objdump on /lib/arm-linux-gnueabihf/libm-2.31.so, I have the following dump (extracts):

00007570 <matherr@GLIBC_2.4-0xc8>:
call_weak_fn():
./csu/../sysdeps/arm/crti.S:64
    7570:   ldr r3, [pc, #20]   ; 758c <__assert_fail@plt+0x2c>
./csu/../sysdeps/arm/crti.S:65
    7574:   ldr r2, [pc, #20]   ; 7590 <__assert_fail@plt+0x30>
./csu/../sysdeps/arm/crti.S:67
    7578:   add r3, pc, r3
./csu/../sysdeps/arm/crti.S:68
    757c:   ldr r2, [r3, r2]
./csu/../sysdeps/arm/crti.S:69
    7580:   cmp r2, #0
./csu/../sysdeps/arm/crti.S:70
    7584:   bxeq    lr

On this first one everything is fine, I can find the instructions of the addresses pointed by callgrind.

000084e8 <sqrt@@GLIBC_2.4>:
__sqrt():
./math/w_sqrt_compat.c:31
    84e8:   vcmp.f64    d0, #0.0
./math/w_sqrt_compat.c:30
    84ec:   ldr r3, [pc, #36]   ; (8514 <sqrt@@GLIBC_2.4+0x2c>)
    84ee:   vmov.f64    d1, d0
    84f2:   add r3, pc
./math/w_sqrt_compat.c:31
    84f4:   vmrs    APSR_nzcv, fpscr
    84f8:   bmi.n   8502 <sqrt@@GLIBC_2.4+0x1a>
./math/w_sqrt_compat.c:34
    84fa:   vmov.f64    d0, d1
    84fe:   b.w 143bc <__sqrt_finite@GLIBC_2.15>

However on this second extract, I have a one-byte shift between addresses in callgrind and addresses in objdump so I can't match the addresses to the corresponding instruction.

When I try to match a whole callgrind dump, almost all addresses are not able to be matched because shifted.

When I do the same process on a x86_64 program, callgrind and objdump always match perfectly.

Is there something I don't understand about the natures of callgrind and objdump outputs? Or is it normal somehow?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Benjamin Barrois
  • 2,566
  • 13
  • 30

0 Answers0