Skip to content

Swift calling conventions #3914

Description

@comex

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 BNCustomCallingConvention API: e.g., x20 is used for self and can be treated as another integer argument. Others cannot: e.g., Swift uses up to 4 registers for integer return values (x0 through x3), plus a fifth for error values (x21), whereas BNCustomCallingConvention seems 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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions