Created
June 20, 2014 15:44
-
-
Save lnicola/467b0fb6d49b20fa274c to your computer and use it in GitHub Desktop.
small ARM Linux executable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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