arch-x86: properly initialize the auxv platform string (#347)

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
This commit is contained in:
Bobby R. Bruce
2023-09-27 14:31:19 -07:00
committed by GitHub

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);