aboutsummaryrefslogtreecommitdiff
path: root/exec
diff options
context:
space:
mode:
Diffstat (limited to 'exec')
-rw-r--r--exec/elfcore.c13
-rw-r--r--exec/exec.c5
2 files changed, 18 insertions, 0 deletions
diff --git a/exec/elfcore.c b/exec/elfcore.c
index 12ecf34f..2dd499bf 100644
--- a/exec/elfcore.c
+++ b/exec/elfcore.c
@@ -331,6 +331,7 @@ dump_core (task_t task, file_t file, off_t corelimit,
{
DEFINE_NOTE (psinfo_t) psinfo;
DEFINE_NOTE (pstatus_t) pstatus;
+ DEFINE_NOTE (ElfW(auxv_t)) at_entry;
int flags = PI_FETCH_TASKINFO | PI_FETCH_THREADS | PI_FETCH_THREAD_BASIC;
char *waits = 0;
mach_msg_type_number_t num_waits = 0;
@@ -410,6 +411,18 @@ dump_core (task_t task, file_t file, off_t corelimit,
err = proc_get_arg_locations (proc,
&psinfo.data.pr_argv,
&psinfo.data.pr_envp);
+ if (err == 0)
+ {
+ /* Write position of executable. */
+ vm_address_t addr;
+ err = proc_get_entry (proc, &addr);
+ if (err == 0)
+ {
+ at_entry.data.a_type = AT_ENTRY;
+ at_entry.data.a_un.a_val = addr;
+ err = WRITE_NOTE (NT_AUXV, at_entry);
+ }
+ }
mach_port_deallocate (mach_task_self (), proc);
}
{
diff --git a/exec/exec.c b/exec/exec.c
index d78c54c5..2d74ee1c 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1234,6 +1234,11 @@ do_exec (file_t file,
goto out;
set_name (newtask, argv, pid);
+
+ e.error = proc_set_entry (boot->portarray[INIT_PORT_PROC],
+ e.entry);
+ if (e.error)
+ goto out;
}
else
set_name (newtask, argv, 0);