Add text_size and data_size to struct exec_info
This commit is contained in:
parent
a2fcba659c
commit
c48ac699d9
|
|
@ -228,6 +228,11 @@ int libexec_load_elf(struct exec_info *execi)
|
||||||
if(first || startv > vaddr) startv = vaddr;
|
if(first || startv > vaddr) startv = vaddr;
|
||||||
first = 0;
|
first = 0;
|
||||||
|
|
||||||
|
if ((ph->p_flags & PF_X) != 0 && execi->text_size < seg_membytes)
|
||||||
|
execi->text_size = seg_membytes;
|
||||||
|
else
|
||||||
|
execi->data_size = seg_membytes;
|
||||||
|
|
||||||
if(try_mmap && execi->memmap(execi, vaddr, fbytes, foffset, clearend, mmap_prot) == OK) {
|
if(try_mmap && execi->memmap(execi, vaddr, fbytes, foffset, clearend, mmap_prot) == OK) {
|
||||||
#if ELF_DEBUG
|
#if ELF_DEBUG
|
||||||
printf("libexec: mmap 0x%lx-0x%lx done, clearend 0x%x\n",
|
printf("libexec: mmap 0x%lx-0x%lx done, clearend 0x%x\n",
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ struct exec_info {
|
||||||
int allow_setuid; /* Allow set{u,g}id execution? */
|
int allow_setuid; /* Allow set{u,g}id execution? */
|
||||||
vir_bytes stack_size; /* Desired stack size */
|
vir_bytes stack_size; /* Desired stack size */
|
||||||
vir_bytes load_offset; /* Desired load offset */
|
vir_bytes load_offset; /* Desired load offset */
|
||||||
|
vir_bytes text_size; /* Text segment size */
|
||||||
|
vir_bytes data_size; /* Data segment size */
|
||||||
off_t filesize; /* How big is the file */
|
off_t filesize; /* How big is the file */
|
||||||
|
|
||||||
/* Callback pointers for use by libexec */
|
/* Callback pointers for use by libexec */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user