diff options
author | tijl <tijl@FreeBSD.org> | 2013-02-27 09:34:09 +0000 |
---|---|---|
committer | tijl <tijl@FreeBSD.org> | 2013-02-27 09:34:09 +0000 |
commit | 1378fd6863ec7ef6fcc1d8572c7d321ef79dd4ea (patch) | |
tree | 879b062d01fab89812d0f268be99fd361989fe5d /libexec | |
parent | 5f76bacc85b3a693245db8b1cbce583dfadc4b10 (diff) | |
download | FreeBSD-src-1378fd6863ec7ef6fcc1d8572c7d321ef79dd4ea.zip FreeBSD-src-1378fd6863ec7ef6fcc1d8572c7d321ef79dd4ea.tar.gz |
Map libraries linked with -Ttext-segment=base_addr at base_addr.
Normal libraries have base address 0 and are unaffected by this change.
PR: 176216
Submitted by: Damjan Jovanovic <damjan.jov@gmail.com>
Reviewed by: kib
MFC after: 1 week
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rtld-elf/map_object.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index 79e4132..0f75cca 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -175,7 +175,7 @@ map_object(int fd, const char *path, const struct stat *sb) base_vaddr = trunc_page(segs[0]->p_vaddr); base_vlimit = round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz); mapsize = base_vlimit - base_vaddr; - base_addr = hdr->e_type == ET_EXEC ? (caddr_t) base_vaddr : NULL; + base_addr = (caddr_t) base_vaddr; mapbase = mmap(base_addr, mapsize, PROT_NONE, MAP_ANON | MAP_PRIVATE | MAP_NOCORE, -1, 0); |