Explicitly zero-clear stack array to read dynamic segments. This code has
been working because stack is mapped as anon and zero'ed right after execve(2).
Found by work-in-progress Valgrind port for OpenBSD/amd64.
OK millert@ guenther@
-/* $OpenBSD: boot.c,v 1.2 2014/07/06 17:33:10 otto Exp $ */
+/* $OpenBSD: boot.c,v 1.3 2014/08/19 10:01:50 uebayasi Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
#else
dynp = (Elf_Dyn *)((long)_DYNAMIC + loff);
#endif
+ _dl_memset(dynld.Dyn.info, 0, sizeof(dynld.Dyn.info));
while (dynp != NULL && dynp->d_tag != DT_NULL) {
if (dynp->d_tag < DT_NUM)
dynld.Dyn.info[dynp->d_tag] = dynp->d_un.d_val;