Skip to content

Instantly share code, notes, and snippets.

@lnicola
Created June 20, 2014 15:44
Show Gist options
  • Save lnicola/467b0fb6d49b20fa274c to your computer and use it in GitHub Desktop.
Save lnicola/467b0fb6d49b20fa274c to your computer and use it in GitHub Desktop.
small ARM Linux executable
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
.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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment