--- Makefile.am
+++ Makefile.am
@@ -10,6 +10,7 @@
 	ziploader.c ziploader.h
 EXTRA_tuxnes_SOURCES = pixels.h
 tuxnes_LDADD = table.o
+tuxnes_LDFLAGS = -Wl,-z,noexecstack
 
 comptbl_SOURCES = comptbl.c
 
--- x86.S
+++ x86.S
@@ -1670,3 +1670,6 @@
  leal   0x1(%eax),%ebx
  popl   %eax
  jmp i_next
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
