Only take the first flags

This commit is contained in:
Jōshin 2024-05-06 16:58:11 -07:00
parent 7aef5c786a
commit e788df7643
No known key found for this signature in database

View file

@ -999,7 +999,7 @@ EXTERN_C __attribute__((__noreturn__)) void ApeLoader(long di, long *sp,
pagesz = ap[1];
} else if (SupportsNetbsd() && !os && ap[0] == AT_EXECFN_NETBSD) {
os = NETBSD;
} else if (ap[0] == AT_FLAGS) {
} else if (!flags && ap[0] == AT_FLAGS) {
// TODO(mrdomino): does anyone use auxv 8 for anything else?
flags = ap;
arg0 = !!(ap[1] & AT_FLAGS_PRESERVE_ARGV0);