Index: libexec/rtld-elf/rtld.c =================================================================== --- libexec/rtld-elf/rtld.c +++ libexec/rtld-elf/rtld.c @@ -512,12 +512,13 @@ argv[i] = argv[i + rtld_argc]; *argcp -= rtld_argc; environ = env = envp = argv + main_argc + 1; + dbg("move env from %p to %p", envp + rtld_argc, envp); do { *envp = *(envp + rtld_argc); - envp++; - } while (*envp != NULL); + } while (*envp++ != NULL); aux = auxp = (Elf_Auxinfo *)envp; auxpf = (Elf_Auxinfo *)(envp + rtld_argc); + dbg("move aux from %p to %p", auxpf, aux); for (;; auxp++, auxpf++) { *auxp = *auxpf; if (auxp->a_type == AT_NULL)