diff options
author | imp <imp@FreeBSD.org> | 2015-05-22 20:50:35 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2015-05-22 20:50:35 +0000 |
commit | b8ed2d07c4d59d2f5a3198cb1c2b79538d14e0d7 (patch) | |
tree | 83b35d75e3358fb581b2d01f8303b7f705007fea /sys/kern/imgact_elf.c | |
parent | e69f995011be8cb49bae9a5cd1e3149e06cfe729 (diff) | |
download | FreeBSD-src-b8ed2d07c4d59d2f5a3198cb1c2b79538d14e0d7.zip FreeBSD-src-b8ed2d07c4d59d2f5a3198cb1c2b79538d14e0d7.tar.gz |
Export the eflags field from the elf header. This allows better
discrimination between different subarch binaries, at least for mips
and arm. Arm is implemented, mips is still tbd, so not currently
exported. aarch64 does not export this because aarch64 binaries use
different tags and flags than arm.
Differential Revision: https://reviews.freebsd.org/D2611
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r-- | sys/kern/imgact_elf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 3ff3440..ca0048a 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -972,6 +972,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) elf_auxargs->base = addr; elf_auxargs->flags = 0; elf_auxargs->entry = entry; + elf_auxargs->hdr_eflags = hdr->e_flags; imgp->auxargs = elf_auxargs; imgp->interpreted = 0; @@ -1002,6 +1003,9 @@ __elfN(freebsd_fixup)(register_t **stack_base, struct image_params *imgp) AUXARGS_ENTRY(pos, AT_FLAGS, args->flags); AUXARGS_ENTRY(pos, AT_ENTRY, args->entry); AUXARGS_ENTRY(pos, AT_BASE, args->base); +#ifdef AT_EHDREFLAGS + AUXARGS_ENTRY(pos, AT_EHDRFLAGS, args->hdr_eflags); +#endif if (imgp->execpathp != 0) AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp); AUXARGS_ENTRY(pos, AT_OSRELDATE, |