-
Notifications
You must be signed in to change notification settings - Fork 298
Swift calling conventions #3914
Copy link
Copy link
Open
Labels
Component: PlatformCore: Calling ConventionEffort: MediumIssues require < 1 month of workIssues require < 1 month of workImpact: MediumIssue is impactful with a bad, or no, workaroundIssue is impactful with a bad, or no, workaround
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
Component: PlatformCore: Calling ConventionEffort: MediumIssues require < 1 month of workIssues require < 1 month of workImpact: MediumIssue is impactful with a bad, or no, workaroundIssue is impactful with a bad, or no, workaround
What is the feature you'd like to have?
Swift has a custom calling convention on x86-64 and arm64 with some differences from the platform's standard one.
Some of these differences can be modeled using Binary Ninja's
BNCustomCallingConventionAPI: e.g.,x20is used forselfand can be treated as another integer argument. Others cannot: e.g., Swift uses up to 4 registers for integer return values (x0throughx3), plus a fifth for error values (x21), whereasBNCustomCallingConventionseems to support at most two integer return registers.In any case, since Swift code is becoming quite common on Apple platforms, it would be nice if Binary Ninja supported Swift calling conventions out of the box.