mambo
mambo copied to clipboard
Incorrect pcrel address calculation in Thumb
All of the: ((uint32_t)read_address) + 2 + 1 should be: ALIGN_DOWN(read_address, 4)
Generally, no. Care to expand on that?
Sorry, I find that the alignment has been processed in get_origin_pc :)
In addition, I found that mambo seemed to be working incorrectly with ldr.w pc, [pc, #4], which was resolved to THUMB_LDRL32, whereas in this case, rdn = pc, assert(rdn! = pc) will be triggered.
That's not incorrect, it's just not implemented because we've never encountered it in an application. If you did and you could point me to the executable, I can add support for that instruction.
Since it's an old issue and I have no way of testing it at the moment, I'm going to close it in the effort to clean up the repo. If anyone still requires this fix, please re-open the issue and I can look into it.