Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Tricore: add a FCALL calling convention #7331

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

esaulenka
Copy link
Contributor

While working with tricore binary I found that some small routines can be called through FCALL (fast call) opcode, not by common CALL.
And even though it is already supported in sleigh, it produces a wrong decompiled code if caller function uses stack variables, because CALL and FCALL handle stack in a different manner.

So, here is two patches:

  • add a new calling convention to support these functions
  • copy of the HCS12 plugin to automatically detect such functions.

some notes:

  • I'm not sure that the FCALL can be used in the C++ code (to be honest, I have never seen C++ tricore binaries)
  • I'm not sure about parameters transferred through stack. For common functions it working good enough, but my sample use the only few fast calls with just a few arguments, there is no stack usage to transfer parameters.

@ryanmkurtz ryanmkurtz added the Status: Triage Information is being gathered label Jan 5, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants