I just noticed that my simple program has its executables and stack segments. I saw it in / proc / [pid] / maps, and simple code confirmed it.
For example:
; prog.asm section .data code: db 0xCC ;int3 section .text global _start _start: jmp code mov rax, 60 ; sys_exit mov rdi, 0 syscall
then
nasm -f elf64 prog.asm ld -o prog prog.o ./prog
forces prog to execute the int3 command.
Programs written in C and built using gcc have their own data, the stack and a bunch of unexecutable ones, so why do the ones written in the assembly behave differently?
assembly linux nasm memory-mapping
witosx Oct 22 2018-11-23T00: 00Z
source share