Command line arguments should be passed in the stack of the created task.
| Stack |
| ----------------------------------- |
| Arg 0 | <- start of the stack
| Arg 1 |
| ... |
| Arg n |
| The constant n |
| A pointer to the start of the stack |
| ... | <- SP points here
Example of the _start function in glibc for aarch64:
ENTRY(_start)
...
/* Load argc and a pointer to argv */
ldr PTR_REG (1), [sp, #0]
add x2, sp, #PTR_SIZE
/* Setup stack limit in argument register */
mov x6, sp
...
Command line arguments should be passed in the stack of the created task.
Example of the
_start
function in glibc for aarch64: