Home | History | Annotate | Download | only in ld-arm
      1 	.text
      2 	.p2align 4
      3 	.globl _start
      4 _start:
      5 	mov	ip, sp
      6 	stmdb	sp!, {r11, ip, lr, pc}
      7 	bl	app_func
      8 	bl	lib_func1
      9 	bl	lib_func2
     10 	ldmia	sp, {r11, sp, lr}
     11 	bx lr
     12 
     13 	.p2align 4
     14 	.globl app_tfunc_close
     15 	.type app_tfunc_close,%function
     16 	.thumb_func
     17 	.code 16
     18 app_tfunc_close:
     19 	push	{lr}
     20 	bl	lib_func2
     21 	pop	{pc}
     22 	bx	lr
     23 
     24 @ We will place the section .mid_thumb at 0xFFFEF8.
     25 @ Just far enough for XXXX
     26 	.section .mid_thumb, "xa"
     27 
     28 	.p2align 4
     29 	.globl mid_tfunc
     30 	.type mid_tfunc,%function
     31 	.thumb_func
     32 	.code 16
     33 mid_tfunc:
     34 	.syntax unified
     35 	.space 24
     36 	b.w	lib_func2
     37 	b.w	lib_func2
     38 
     39 @ We will place the section .far_arm at 0x2100000.
     40 	.section .far_arm, "xa"
     41 
     42 	.arm
     43 	.p2align 4
     44 	.globl app_func
     45 	.type app_func,%function
     46 app_func:
     47 	mov	ip, sp
     48 	stmdb	sp!, {r11, ip, lr, pc}
     49 	bl	lib_func1
     50 	bl	lib_func2
     51 	ldmia	sp, {r11, sp, lr}
     52 	bx lr
     53 
     54 	.arm
     55 	.p2align 4
     56 	.globl app_func2
     57 	.type app_func2,%function
     58 app_func2:
     59 	bx	lr
     60 
     61 @ We will place the section .far_thumb at 0x2200000.
     62 	.section .far_thumb, "xa"
     63 
     64 	.p2align 4
     65 	.globl app_tfunc
     66 	.type app_tfunc,%function
     67 	.thumb_func
     68 	.code 16
     69 app_tfunc:
     70 	push	{lr}
     71 	bl	lib_func2
     72 	pop	{pc}
     73 	bx	lr
     74 
     75 	.data
     76 	.long data_obj
     77