This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add Prefer_MAP_32BIT_EXEC to map executable pages with MAP_32BIT
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: "Michael Kerrisk (man-pages)" <mtk dot manpages at gmail dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, linux-man <linux-man at vger dot kernel dot org>
- Cc: Jeff Law <law at redhat dot com>, Zack Weinberg <zackw at panix dot com>, Andi Kleen <andi at firstfloor dot org>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 16 Dec 2015 09:04:05 -0500
- Subject: Re: [PATCH] Add Prefer_MAP_32BIT_EXEC to map executable pages with MAP_32BIT
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOo1OBOGruWMoLTx96wnkKUYPzBZ5HcOCFdGJEp+jTRzVA at mail dot gmail dot com> <56716EDC dot 7020205 at gmail dot com>
On 12/16/2015 09:02 AM, Michael Kerrisk (man-pages) wrote:
> (Thanks, Carlos.)
>
>> Here is a patch for Linux man page.
>
> Thanks, H.J. I applied the patch and tweaked your text somewhat.
> Does the following look okay?
>
> LD_PREFER_MAP_32BIT_EXEC
> (x86-64 only)(glibc since 2.23) According to the Intel
> Silvermont software optimization guide, for 64-bit appliâ
> cations, branch prediction performance can be negatively
> impacted when the target of a branch is more than 4GB away
> from the branch. If this environment variable is set (to
> any value), ld.so will first try to map executable pages
> using the mmap(2) MAP_32BIT flag, and fall back to mapping
> without that flag if that attempt fails. NB: MAP_32BIT
> will map to the low 2GB (not 2GB) of the address space.
> Because MAP_32BIT reduces the address range available for
> address space layout randomization (ASLR), LD_PREâ
> FER_MAP_32BIT_EXEC is always disabled in secure-execution
> mode.
Looks great. Thanks for the quick turnaround Michael!
Cheers,
Carlos.