aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/cloudabi64/cloudabi64_module.c
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2016-03-31 18:52:00 +0000
committerEd Schouten <ed@FreeBSD.org>2016-03-31 18:52:00 +0000
commit4a8b3b18cc03881645c48fadcec367df3518273c (patch)
tree3d8c734dbc00dd69e8df1fdf7b64427a2564642c /sys/compat/cloudabi64/cloudabi64_module.c
parent2054309b6a8028cdbf9891ac5dffb6e1b52c81db (diff)
downloadsrc-4a8b3b18cc03881645c48fadcec367df3518273c.tar.gz
src-4a8b3b18cc03881645c48fadcec367df3518273c.zip
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.
Notes
Notes: svn path=/head/; revision=297470
Diffstat (limited to 'sys/compat/cloudabi64/cloudabi64_module.c')
-rw-r--r--sys/compat/cloudabi64/cloudabi64_module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/compat/cloudabi64/cloudabi64_module.c b/sys/compat/cloudabi64/cloudabi64_module.c
index 60100c5a6717..de890bc5c652 100644
--- a/sys/compat/cloudabi64/cloudabi64_module.c
+++ b/sys/compat/cloudabi64/cloudabi64_module.c
@@ -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),