Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Go stack return support #7529

Open
astrelsky opened this issue Feb 20, 2025 · 1 comment
Open

Go stack return support #7529

astrelsky opened this issue Feb 20, 2025 · 1 comment

Comments

@astrelsky
Copy link
Contributor

astrelsky commented Feb 20, 2025

Is your feature request related to a problem? Please describe.
I'm always frustrated with 32 bit go programs that pass and return on the stack because it creates a handful of problems. Not only do you need to manually use custom storage and apply and correct all function signatures by hand, but all interface functions will never decompile correctly because no function pointer will be able to have the correct return storage, even after going out of the way to create an appropriate itab.

Describe the solution you'd like
Support for returning values on the stack after the parameters.

Describe alternatives you've considered
I've gotten really good at the necessary mental gymnastics for this sort of thing but any help would be great.

Additional Context
This issue actually applies to all of the incomplete go calling conventions, which is all of them, because they all currently require custom storage, which means no proper function pointers.

@astrelsky
Copy link
Contributor Author

I'm managing to get by for now by using a similar technique used for syscalls with call overrides in an artificial overlay. I have to do this manually for every interface function and every runtime.newobject. I also have to manually set custom storage on every single function which is about as tedious as you can imagine.

This is a hack but it works for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant