This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR880088 Enable -Wtrampolines for no-exec-stack targets with -Wall.
On Tue, Nov 27, 2018 at 08:54:07PM +0100, Mark Wielaard wrote:
> On Tue, 2018-11-27 at 12:37 -0600, Segher Boessenkool wrote:
> > > Define a new target macro TARGET_HAS_DEFAULT_NOEXEC_STACK for those
> > > targets
> > > that have a non-executable default stack based on when they call
> > > file_end_indicate_exec_stack.
> >
> > As Paul says, that name isn't so good.
> >
> > TARGET_NEEDS_MAKING_THE_STACK_EXECUTABLE_FOR_TRAMPOLINES, or similar?
>
> Would the slightly shorter
> TARGET_NEEDS_EXEC_STACK_MARKER_FOR_TRAMPOLINES be descriptive enough?
"MARKER", is that some official name for it? If no, just "FLAG"?
Fine with me, sure.
> > > diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
> > > index 0c67634..9330acf 100644
> > > --- a/gcc/config/rs6000/sysv4.h
> > > +++ b/gcc/config/rs6000/sysv4.h
> > > @@ -972,6 +972,11 @@ ncrtn.o%s"
> > > /* Generate entries in .fixup for relocatable addresses. */
> > > #define RELOCATABLE_NEEDS_FIXUP 1
> > >
> > > +#if defined (POWERPC_LINUX) || defined (POWERPC_FREEBSD)
> > > + #define TARGET_HAS_DEFAULT_NOEXEC_STACK (TARGET_32BIT \
> > > + || DEFAULT_ABI == ABI_ELFv2)
> > > +#endif
> >
> > I don't think this belongs in sysv4.h .
>
> I might have gotten lost in the tree of defines/macros.
>
> There are two sysv4.h files gcc/config/rs6000/sysv4.h and
> gcc/config/powerpcspe/sysv4.h
Forget about powerpcspe please, I am talking about rs6000 only.
You want linux.h and freebsd.h, maybe the "64" versions of those separately.
Or put this in rs6000.h. sysv4.h is a random header for this, it doesn't
belong there.
Segher