Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

crt0.S does not get argv[] using SYS_GETCMDLINE #46

Open
ilg-ul opened this issue Jul 21, 2022 · 0 comments
Open

crt0.S does not get argv[] using SYS_GETCMDLINE #46

ilg-ul opened this issue Jul 21, 2022 · 0 comments

Comments

@ilg-ul
Copy link

ilg-ul commented Jul 21, 2022

The startup code expects the main() arguments to be processed by someone else and does not call SYS_GETCMDLINE to get them, as specified by Arm semihosting:

This might work on some specific platforms, but generally it fails, since that area is right after the stack, usually an invalid memory region.

The workaround for semihosted applications it to rewrite the startup code.

The solution for newlib is to replicate the logic used by the Arm startup code, which processes the arguments properly.

It might also be a good idea to call SYS_HEAPINFO and properly process the heap/stack.

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

No branches or pull requests

1 participant