This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PCH and exec-shield...
Ian Lance Taylor <ian@wasabisystems.com> writes:
> law@redhat.com writes:
>
> > Alternately, I believe we could have the build process mark cc1plus and
> > friends as not needing/wanting the exec-shield functionality. IIRC there
> > is a program you can run which twiddles bits in the ELF headers/sections
> > which allow you to control exec-shield on a per-binary basis.
>
> Not to get too far out, but is there any way that PCH could work even
> when exec-shield is enabled?
I believe this is now a FAQ on this list.
Yes, this can be done. All you have to do is to find a chunk of
address space that is safe, and write HOST_HOOKS_GT_PCH_GET_ADDRESS and
HOST_HOOKS_GT_PCH_USE_ADDRESS routines. For an example, look at
config/rs6000/host-darwin.c; the hooks are also documented in texinfo.
How to find 'safe' address space? The approach in host-darwin.c is
probably not a good idea on x86 linux, but there are regions of
address space that are unused; you might need to write a linker script
fragment to reserve them, or maybe they'll be free by default.
--
- Geoffrey Keating <geoffk@geoffk.org>