small ARM Linux executable
.global _start
_start:
mov r0, #1
ldr r1, .L1
mov r2, #14
mov r7, #4
swi #0
mov r7, #1
swi #0
.L1:
.word .L2
.L2: .ascii "Hello, world!\n"
all:
gcc -pipe -nostdlib -nostartfiles -Qn -Wl,--build-id=none -o tiny-hello tiny-hello.s
strip -R .ARM.attributes tiny-hello
! ./tiny-hello
ls -l tiny-hello
clean:
rm -f tiny-hello