Why data and stack segments are executable?
On modern Linux systems, the linker will mark stack/data non-executable IFF all objects that participate in the link have a special “marker” section .note.GNU-stack. If you compile e.g. int foo() { return 1; } into assembly (with gcc -S foo.c), you’ll see this: .section .note.GNU-stack,””,@progbits For nasm, the syntax is shown in section 8.9.2 of … Read more