ghidra
ghidra copied to clipboard
Unmodelable Calling Conventions
Describe the bug I am elevating #4551 to an issue.
To Reproduce Steps to reproduce the behavior:
- Attempt to create a calling convention from the V2 specification from the documentation linked in the discussion.
Expected behavior It should be possible to implement any static calling convention. By static I simply mean to exclude the special dynamic calling convention handling used in the Dalvik cspec.
Additional context I think that allowing joined registers in a group would be a good start.
Sorry, my (deleted) previous post was incorrect as things have envolved. We will have to look into the join must overlap sequential entries
issue. Unfortunately, while all of this may help with the foward direction (i.e., auto storage allocation when signature is know) it may not be handled well by decompiler since ordinal assignments (i.e., parameter sequence) would be inderterminate.
Sorry, my (deleted) previous post was incorrect as things have envolved. We will have to look into the
join must overlap sequential entries
issue. Unfortunately, while all of this may help with the foward direction (i.e., auto storage allocation when signature is know) it may not be handled well by decompiler since ordinal assignments (i.e., parameter sequence) would be inderterminate.
You lied to me?!? I didn't even see the previous post before it was deleted so no worries.
I do have more problems from the processor/compiler from hell though. A far pointer is 3 bytes but PUSH/POP
instructions are only for 2 byte values/registers. So when it pushes a far pointer the segment portion gets reversed (low high trash segment) and no matter how the custom storage is defined the pointer gets split up at the start of the function. I already tried to see if I could join to different stack locations like you can with a register but it didn't allow it.