From 59b80e29c650d17aea42118943934f1adba92af7 Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Tue, 30 Dec 2008 13:43:51 +0000 Subject: [PATCH] Fill out empty auxv glibc's startup code expects to find an auxv and it's better to change sel_ldr to provide one --- service_runtime/sel_ldr_standard.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/service_runtime/sel_ldr_standard.c b/service_runtime/sel_ldr_standard.c index cc2d6ea7..189d2057 100644 --- a/service_runtime/sel_ldr_standard.c +++ b/service_runtime/sel_ldr_standard.c @@ -496,7 +496,7 @@ int NaClCreateMainThread(struct NaClApp *nap, size += envv_len[i]; } - size += (argc + envc + 2) * sizeof(char *) + sizeof(int); + size += (argc + envc + 4) * sizeof(char *) + sizeof(int); size = (size + PTR_ALIGN_MASK) & ~PTR_ALIGN_MASK; @@ -511,7 +511,7 @@ int NaClCreateMainThread(struct NaClApp *nap, VCHECK(0 == (esp & PTR_ALIGN_MASK), ("esp not aligned: %08x\n", esp)); p = (char *) esp; - strp = p + (argc + envc + 2) * sizeof(char *) + sizeof(int); + strp = p + (argc + envc + 4) * sizeof(char *) + sizeof(int); #define BLAT(t, v) do { \ *(t *) p = (t) v; p += sizeof(t); \ @@ -532,6 +532,9 @@ int NaClCreateMainThread(struct NaClApp *nap, strp += envv_len[i]; } BLAT(char *, 0); + /* Empty auxv */ + BLAT(char *, 0); + BLAT(char *, 0); #undef BLAT /* now actually spawn the thread */ -- 2.11.4.GIT