Fix the AT_EXECFD functionality.
If the mapped object is linked at specific address, we must obey it. If AT_EXECFD is not used, only in-kernel ELF image activator needed to keep the mapping address, since only binaries are linked at the fixed address, and binaries are mapped by kernel in this case. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D10701
This commit is contained in:
parent
3f1466a535
commit
9104191924
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=318312
@ -193,6 +193,8 @@ map_object(int fd, const char *path, const struct stat *sb)
|
|||||||
base_flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE;
|
base_flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE;
|
||||||
if (npagesizes > 1 && round_page(segs[0]->p_filesz) >= pagesizes[1])
|
if (npagesizes > 1 && round_page(segs[0]->p_filesz) >= pagesizes[1])
|
||||||
base_flags |= MAP_ALIGNED_SUPER;
|
base_flags |= MAP_ALIGNED_SUPER;
|
||||||
|
if (base_vaddr != 0)
|
||||||
|
base_flags |= MAP_FIXED | MAP_EXCL;
|
||||||
|
|
||||||
mapbase = mmap(base_addr, mapsize, PROT_NONE, base_flags, -1, 0);
|
mapbase = mmap(base_addr, mapsize, PROT_NONE, base_flags, -1, 0);
|
||||||
if (mapbase == (caddr_t) -1) {
|
if (mapbase == (caddr_t) -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user