add a AT_ENTRY entry to the auxiliary vector

This commit is contained in:
NAKAMURA Gou
2013-10-08 18:51:16 +09:00
parent bb1390b085
commit a171da1015
4 changed files with 5 additions and 0 deletions

View File

@@ -45,6 +45,7 @@ struct program_load_desc {
unsigned long at_phdr;
unsigned long at_phent;
unsigned long at_phnum;
unsigned long at_entry;
char *args;
unsigned long args_len;
char *envs;

View File

@@ -152,6 +152,7 @@ struct program_load_desc *load_elf(FILE *fp)
desc->at_phdr = load_addr + hdr.e_phoff;
desc->at_phent = sizeof(phdr);
desc->at_phnum = hdr.e_phnum;
desc->at_entry = hdr.e_entry;
return desc;
}

View File

@@ -104,6 +104,7 @@ struct program_load_desc {
unsigned long at_phdr;
unsigned long at_phent;
unsigned long at_phnum;
unsigned long at_entry;
char *args;
unsigned long args_len;
char *envs;

View File

@@ -866,6 +866,8 @@ int init_process_stack(struct process *process, struct program_load_desc *pn,
s_ind = -1;
p[s_ind--] = 0; /* AT_NULL */
p[s_ind--] = 0;
p[s_ind--] = pn->at_entry; /* AT_ENTRY */
p[s_ind--] = AT_ENTRY;
p[s_ind--] = pn->at_phnum; /* AT_PHNUM */
p[s_ind--] = AT_PHNUM;
p[s_ind--] = pn->at_phent; /* AT_PHENT */