sgx-lkl
sgx-lkl copied to clipboard
ELF ABI stacks
From #115 via #103: We should support the full ELF stack layout for maximum compatiblity.
@davidchisnall says:
We should probably mirror the layout mandated by the amd64 ELF psABI here the amd64 ELF psABI here (ideally, we'd have that structure on the stack on userspace process start, because that's what the ABI actually requires). The layout there is (from the lowest allocated stack address upwards):
- 64-bit argc
argvas an array of 64-bit pointers.- 64-bit 0
- Environment pointers as an array of 64-bit pointers.
- 64-bit 0
- ELF auxiliary argument vector (array of pairs of 64-bit values)
- 64-bit 0.
- Platform-specific things, including all of the things that the pointer arrays point to.