On Mon, 2018-11-26 at 08:19 -0500, Paul Koning wrote: > > On Nov 26, 2018, at 4:13 AM, Mark Wielaard <m...@klomp.org> wrote: > > > > With -Wtrampolines a warning is produced whenever gcc generates > > executable > > code on the stack at runtime to support taking a nested function > > address > > that is used to call the nested function indirectly when it needs > > to access > > any variables in its lexical scope. > > > > As a result the stack has to be marked as executable even for > > targets which > > have a non-executable stack as default. > > > > 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. > > The word "default" suggests this is a constant attribute of the > platform. Can it be variable?
No. The new target macro is just for those targets that have no executable stack by default. It basically tracks those targets that have a static rule for calling file_end_indicate_exec_stack () from their TARGET_ASM_FILE_END hook. See also the new documentation for the target macro and the existing documentation for the TARGET_ASM_FILE_END hook. I would also be fine with having -Wall enable -Wtrampolines by default. But in the bug report it was argued that it should only for targets with a default non-executable stack where gcc would otherwise silently make the whole stack executable. Cheers, Mark