Michael Hudson-Doyle <michael.hud...@linaro.org> writes:

> I guess I don't understand the adrp code.  My understanding is that:
>
> 0x00000000004b4b78 <+12>:    adrp    x0, 0x64c000
>
> would result in 0x4b4000 + 0x64c000 in x0 and then
>
> 0x00000000004b4b7c <+16>:    ldr     x0, [x0,#776]
>
> reads from 0x4b4000 + 0x64c000 + 776 but
>
> (gdb) x 0x4b4000 + 0x64c000 + 776
> 0xb00308:       Cannot access memory at address 0xb00308
>
> (I'm not sure if the disassembly for adrp has the immediate shifted or
> not, but anyway:

Oh, I see the disassembly calculates the address...

(gdb) x/g 0x64c000 + 776 
0x64c308:       0x0000000000648680
(gdb) p *((long long*)(0x64c000 + 776)) == ($x0 - $x1)
$3 = true

So that bit makes sense now.

Cheers,
mwh

_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to