Skip to main content
Tweeted twitter.com/#!/StackReverseEng/status/426749719311028225
Removed `linux` tag, as this is not Linux-specific
Link
Jason Geffner
  • 20.7k
  • 1
  • 37
  • 75
Source Link
user1743
user1743

ARM debugging interesting behavior

I was just disassembling and debugging an ARM binary for fun and I noticed something unusual. Consider the following set of instructions:-

   0x00008058 <+4>: mov r1, pc
   0x0000805c <+8>: add r1, r1, #24
   0x00008060 <+12>:    mov r0, #1

I tried setting a breakpoint at 0x0000805c and checked the value of the register r1. I was expecting to see 0x0000805c -- however, interestingly the value is 0x8060.

Why is this? Is this because of some sort of instruction pipelineing?