Why does compiling this simple assembly code and linking to ELF result in such a bigger size than flat binary?
问题 I'm working with an embedded OS like environment, and so size of binaries needs to be as small as possible. I had been using simple flat binary files as an executable, but now I'm trying to use ELF. I'm just using assembly code, but linking with ld. Assembly code: CPU i386 BITS 32 SECTION .text progbits alloc exec nowrite GLOBAL start start: mov eax, 0 add eax, 1 inc eax mov eax, 0x12345678 mov dword [0x100000], eax mov ebx, dword [0x100000] mov eax, ebx out 0xF3, al ;dump memory API call out