arch-x86: properly initialize the auxv platform string

The auxv platform string was not copied to the same location that was
pointed to by the value of AT_PLATFORM; instead, it was copied over
the auxv random buffer. This patch fixes this by copying the auxv
platform string to the right offset in the initial program stack.

GitHub issue: https://github.com/gem5/gem5/issues/346

Change-Id: Ied4b660d5fc444a94acb97b799be0a3722438b5e
This commit is contained in:
Nicholas Mosier
2023-09-21 05:16:17 +00:00
parent 958eda6961
commit 7298ebd49b

View File

@@ -997,7 +997,8 @@ X86Process::argsInit(int pageSize,
initVirtMem->write(auxv_array_end, zero);
auxv_array_end += sizeof(zero);
initVirtMem->writeString(aux_data_base, platform.c_str());
initVirtMem->writeString(aux_data_base + numRandomBytes,
platform.c_str());
copyStringArray(envp, envp_array_base, env_data_base,
ByteOrder::little, *initVirtMem);