Make Position Independent Executables work for CloudABI.
- Set BI_CAN_EXEC_DYN, so we can execute ET_DYN ELF files in addition to regular ET_EXECs. - Provide an AT_BASE entry in the auxiliary vector, so the executable knows at which address it got loaded and can apply relocations.
This commit is contained in:
parent
2054309b6a
commit
4a8b3b18cc
@ -156,5 +156,6 @@ Elf64_Brandinfo cloudabi64_brand = {
|
||||
.brand = ELFOSABI_CLOUDABI,
|
||||
.machine = EM_X86_64,
|
||||
.sysvec = &cloudabi64_elf_sysvec,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
.compat_3_brand = "CloudABI",
|
||||
};
|
||||
|
@ -157,5 +157,6 @@ Elf64_Brandinfo cloudabi64_brand = {
|
||||
.brand = ELFOSABI_CLOUDABI,
|
||||
.machine = EM_AARCH64,
|
||||
.sysvec = &cloudabi64_elf_sysvec,
|
||||
.flags = BI_CAN_EXEC_DYN,
|
||||
.compat_3_brand = "CloudABI",
|
||||
};
|
||||
|
@ -99,6 +99,7 @@ cloudabi64_fixup(register_t **stack_base, struct image_params *imgp)
|
||||
#define PTR(type, ptr) { .a_type = (type), .a_ptr = (uintptr_t)(ptr) }
|
||||
PTR(CLOUDABI_AT_ARGDATA, argdata),
|
||||
VAL(CLOUDABI_AT_ARGDATALEN, argdatalen),
|
||||
VAL(CLOUDABI_AT_BASE, args->base),
|
||||
PTR(CLOUDABI_AT_CANARY, canary),
|
||||
VAL(CLOUDABI_AT_CANARYLEN, sizeof(canarybuf)),
|
||||
VAL(CLOUDABI_AT_NCPUS, mp_ncpus),
|
||||
|
Loading…
Reference in New Issue
Block a user