https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87875
--- Comment #10 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to Martin Liška from comment #9) > (In reply to Jakub Jelinek from comment #7) > > Not also sure what happens if the executable and libraries don't need > > executable stack and you later dlopen some shared library that needs it > > (e.g. uses nested functions). Don't remember if ld.so mprotects the main > > stack as well as all others. > > Uff, looks complicated. I've just attached patch that greps for '[stack]' > and reads execute flags.. One possible solution would be to have a global option that will enable executable flag on all stack allocations? Then we can provide a hint from run-time to users. Jakub?