Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/imgact_elf.c
Show First 20 Lines • Show All 1,165 Lines • ▼ Show 20 Lines | __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) | ||||
brand_info = __elfN(get_brandinfo)(imgp, interp, &osrel, &fctl0); | brand_info = __elfN(get_brandinfo)(imgp, interp, &osrel, &fctl0); | ||||
if (brand_info == NULL) { | if (brand_info == NULL) { | ||||
uprintf("ELF binary type \"%u\" not known.\n", | uprintf("ELF binary type \"%u\" not known.\n", | ||||
hdr->e_ident[EI_OSABI]); | hdr->e_ident[EI_OSABI]); | ||||
error = ENOEXEC; | error = ENOEXEC; | ||||
goto ret; | goto ret; | ||||
} | } | ||||
sv = brand_info->sysvec; | sv = brand_info->sysvec; | ||||
sv->brand_info = brand_info; | |||||
kib: How could this work? Imagine you have two brands pointing to the same sysent. Then the latest… | |||||
dchaginAuthorUnsubmitted Not Done Inline Actions
whoops, indeed. thanks. ugh, i need a knowledge about which is brand is in use, but the second way that i see is not good. dchagin: > How could this work? Imagine you have two brands pointing to the same sysent. Then the… | |||||
kibUnsubmitted Not Done Inline ActionsStore the brand in struct proc? kib: Store the brand in struct proc? | |||||
et_dyn_addr = 0; | et_dyn_addr = 0; | ||||
if (hdr->e_type == ET_DYN) { | if (hdr->e_type == ET_DYN) { | ||||
if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0) { | if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0) { | ||||
uprintf("Cannot execute shared object\n"); | uprintf("Cannot execute shared object\n"); | ||||
error = ENOEXEC; | error = ENOEXEC; | ||||
goto ret; | goto ret; | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 1,516 Lines • Show Last 20 Lines |
How could this work? Imagine you have two brands pointing to the same sysent. Then the latest executed brand would always override brand_info in sysvec.