I am using GDB to load an executable on an embedded device. When loading the executable, GDB says:
xPSR: 0x01000000 pc: 0xf0094902 msp: 0x2001b508
Loading section .text, size 0x16240 lma 0x8000000
Loading section .data, size 0x8f0 lma 0x8016240
Start address 0x8000000, load size 92976
As I understand, the pc
is the instruction pointer. I am assuming that "start address" is the starting address for the pc
. However, in the information GDB is giving me, the start address (0x8000000, which is incidentally the same as .text
) is not the same as the pc
(0xf0094902).
What is the difference between pc
and start address? Does is make sense to have the start address be the same as .text
?
I assume the program counter is the current value after you loaded but before you started running. When you start running, then depending on the processor of course, but it most likely describes the address to start executing that loaded code, the address to set the program counter before allowing the processor to run again. If you run then stop quickly you should see something in the .text range for the pc 0x80000000 + 0x16240
The "start address" referred to here is the start of the binary image, not the execution start address. The start address for execution is whatever is held in the reset vector (assuming you are using Cortex-M3 as before?).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With