mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
aarch64 loader passes os (#1042)
* Reorder Launch arguments, pass aarch64 os Third and fourth arguments are now identical between cosmo and Launch. By passing sp as argument 4, we save a bit of register juggling. Fourth argument (os) is now always passed by the loader on aarch64. It is not yet processed by cosmo. Pushing this change separately, as the cosmo side turns out to be somewhat more involved. * cosmo2 receives os from loader FreeBSD aarch64 now traps early rather than pretending to be Linux. o/aarch64/examples/env.com still works on Linux and Xnu.
This commit is contained in:
parent
d8ad34686a
commit
14fe83facd
5 changed files with 30 additions and 20 deletions
|
@ -224,7 +224,7 @@ struct ApeLoader {
|
|||
};
|
||||
|
||||
EXTERN_C long SystemCall(long, long, long, long, long, long, long, int);
|
||||
EXTERN_C void Launch(void *, long, void *, void *, int)
|
||||
EXTERN_C void Launch(void *, long, void *, int, void *)
|
||||
__attribute__((__noreturn__));
|
||||
|
||||
extern char __executable_start[];
|
||||
|
@ -768,7 +768,7 @@ __attribute__((__noreturn__)) static void Spawn(int os, char *exe, int fd,
|
|||
Msyscall(dynbase + code, codesize, os);
|
||||
|
||||
/* call program entrypoint */
|
||||
Launch(IsFreebsd() ? sp : 0, dynbase + e->e_entry, exe, sp, os);
|
||||
Launch(IsFreebsd() ? sp : 0, dynbase + e->e_entry, exe, os, sp);
|
||||
}
|
||||
|
||||
static const char *TryElf(struct ApeLoader *M, union ElfEhdrBuf *ebuf,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue