$ cat hello.c
#include <stdio.h>
int main()
{
printf("Hello world\n");
}
$ gcc -mcpu=cortex-a8 -S hello.c
$ cat hello.s
[...]
main:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
sub sp, sp, #8
ldr r0, .L3
bl puts
sub sp, fp, #12
ldmfd sp, {fp, sp, pc}
.L4:
.align 2
.L3:
.word .LC0
[...]
$ gcc -mcpu=cortex-a8 -O2 -S hello.c
$ cat hello.s
[...]
main:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
@ link register save eliminated.
ldr r0, .L3
b puts
.L4:
.align 2
.L3:
.word .LC0