0
\$\begingroup\$

This question already has an answer here:

The challenge:

Print Hello, world!. Shortest executable wins.

Criteria:

Your program must compile into an ELF x86-64 executable that prints Hello, world! to the screen. The executable must return 0 upon success, and it must run without error.

Provide the source code, as well as the commands used to compile it. The winner is the one with the smallest 64 bit executable. The executable must run in linux.

Example:

In tiny.asm:

; tiny.asm
BITS 64
GLOBAL _start
EXTERN run
SECTION .text
_start:
    call run
    mov eax, 1
    mov ebx, 0
    int 0x80

In run.c:

//run.c
#include <stdio.h>
void run() { 
    puts("Hello, world!"); 
}

Command:

nasm -f elf64 tiny.asm
gcc -c -Os run.c
gcc -Wall -s -nostartfiles tiny.o run.o

Resulting size: 5456 bytes

\$\endgroup\$

marked as duplicate by lirtosiast code-golf Nov 19 '18 at 21:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.