my function name is overwriteFunc, and trying to print function address &overwriteFunc.
I am trying to get function address on ARM64 v8,which returns me a address like this:
Dump of assembler code for function _ZN4test13overwriteFuncEiml@plt:
0x0000000000423a90 <+0>: adrp x16, 0x513000 0x0000000000423a94 <+4>: ldr x17, [x16,#1640] 0x0000000000423a98 <+8>: add x16, x16, #0x668 0x0000000000423a9c <+12>: br x170x423A90 is not the real function address. it jumps to real function overwriteFunc at the last instruction(x17 contains the real function address). Does anyone know why this happens? why ARM has to branch twice instead of once?
0x0000000000423a90 <+0>: adrp x16, 0x513000 0x0000000000423a94 <+4>: ldr x17, [x16,#1640] 0x0000000000423a98 <+8>: add x16, x16, #0x668 0x0000000000423a9c <+12>: br x17
@plt indicates some kind of dynamic linking. So the real address is stored in a table which is likely filled by the loader.
then is there anyway I could get real function address in c++? or change some compiler option.
thanks
It might help that the C++ code is posted, so that we can try to match the C++ code and disassembly code. And is it a bare metal code or an Linux application?