hi, here is an empty 64bit program in openbsd
section .note.openbsd.ident
align 0x02
dd 0x08, 0x04, 0x01
db 'OpenBSD', 0x00
dd 0x00
align 0x02
section .text
global _start
_start:
xor eax, eax
inc al
syscall
i compile it with
nasm -f elf64 simple.asm -o simple.o
ld -o simple simple.o -m elf_x86_64_obsd -nopie
and i get an executable which is 1390 bytes in size (kind of huge).. when i strip it it gets to 904 bytes..
now, my question is this:
when i add a simple data section with
section .data
cr: db 0x05
and recompile it, my executable is now 5001 bytes!!
can someone explain me why does adding a one byte data section increase my executable by more than 4000 bytes in openbsd?