diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-12-11 02:32:26 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-12-11 02:32:26 +0100 |
commit | 0ca198f1f90071a054287c204a3fd1b4ea315e18 (patch) | |
tree | 710b923b98b58c4e5f9546bb18b085baf9288c9e /proc | |
parent | a8fecd7be76342fea85b5129d450ab01738dcbdf (diff) | |
download | hurd-0ca198f1f90071a054287c204a3fd1b4ea315e18.tar.gz hurd-0ca198f1f90071a054287c204a3fd1b4ea315e18.tar.bz2 hurd-0ca198f1f90071a054287c204a3fd1b4ea315e18.zip |
Record executable entry for PIE core dumps
* hurd/process.defs (proc_set_entry, proc_get_entry): New RPCs.
* hurd/process_reply.defs: Add skips for proc_set_entry, proc_get_entry.
* hurd/process_request.defs: Likewise.
* exec/exec.c (do_exec): Call proc_set_entry.
* proc/proc.h (proc): Add p_entry field.
* proc/mgt.c (S_proc_set_entry, S_proc_get_entry): New RPC
implementations.
* exec/elfcore.c (dump_core): Add at_entry note, call proc_get_entry to
get it, and write it with WRITE_NOTE.
Diffstat (limited to 'proc')
-rw-r--r-- | proc/mgt.c | 18 | ||||
-rw-r--r-- | proc/proc.h | 1 |
2 files changed, 19 insertions, 0 deletions
@@ -348,6 +348,24 @@ S_proc_get_arg_locations (struct proc *p, return 0; } +/* Implement proc_set_entry as described in <hurd/process.defs>. */ +kern_return_t +S_proc_set_entry (struct proc *p, vm_address_t entry) +{ + if (!p) + return EOPNOTSUPP; + p->p_entry = entry; + return 0; +} + +/* Implement proc_get_entry as described in <hurd/process.defs>. */ +kern_return_t +S_proc_get_entry (struct proc *p, vm_address_t *entry) +{ + *entry = p->p_entry; + return 0; +} + /* Implement proc_dostop as described in <hurd/process.defs>. */ kern_return_t S_proc_dostop (struct proc *p, diff --git a/proc/proc.h b/proc/proc.h index 333e8840..b33845d9 100644 --- a/proc/proc.h +++ b/proc/proc.h @@ -71,6 +71,7 @@ struct proc vm_address_t p_argv, p_envp; vm_address_t start_code; /* all executable segments are in this range */ vm_address_t end_code; + vm_address_t p_entry; /* executable entry */ int p_status; /* to return via wait */ int p_sigcode; struct rusage p_rusage; /* my usage if I'm dead, to return via wait */ |