imgtools/romtools/rombuild/stubs.s
changeset 2 39c28ec933dd
equal deleted inserted replaced
1:820b22e13ff1 2:39c28ec933dd
       
     1 @ Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 @ All rights reserved.
       
     3 @ This component and the accompanying materials are made available
       
     4 @ under the terms of the License "Eclipse Public License v1.0"
       
     5 @ which accompanies this distribution, and is available
       
     6 @ at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 @
       
     8 @ Initial Contributors:
       
     9 @ Nokia Corporation - initial contribution.
       
    10 @
       
    11 @
       
    12 @ Description:
       
    13 @ DLL Stub routines
       
    14 @ Compile with "gcc -c -Wa,-adhln stubs.s"
       
    15 @
       
    16 .text
       
    17 	.code 32
       
    18 	.globl  arm4_stub
       
    19 arm4_stub:
       
    20 	ldr     ip, [pc]
       
    21 	ldr     pc, [ip]
       
    22 	.word   0x11223344  @ address in IAT/edata
       
    23 
       
    24 	.code 32
       
    25 	.globl  armi_stub
       
    26 armi_stub:
       
    27 	ldr     ip, [pc, #4]
       
    28 	ldr     pc, [ip]
       
    29 	bx      ip
       
    30 	.word   0x11223344  @ address in IAT/edata
       
    31 
       
    32 	.code 16
       
    33 	.globl  thumb_stub
       
    34 thumb_stub:
       
    35 	push    {r6}
       
    36 	ldr     r6, [pc, #8]
       
    37 	ldr     r6, [r6]
       
    38 	mov     ip, r6
       
    39 	pop     {r6}
       
    40 	bx      ip
       
    41 	.word   0x11223344	@ address in IAT/edata
       
    42 
       
    43 	.code 16
       
    44 	.globl  thumb_r3unused_stub
       
    45 thumb_r3unused_stub:
       
    46 	ldr     r3, [pc, #4]
       
    47 	ldr     r3, [r3]
       
    48 	bx      r3
       
    49 	nop
       
    50 	.word   0x11223344	@ address in IAT/edata
       
    51 
       
    52 
       
    53 @ In-place rewrites if destination address
       
    54 @ is fixed
       
    55 @
       
    56 	.code 32
       
    57 	.globl  fast_armi_stub
       
    58 fast_armi_stub:
       
    59 	ldr     ip, [pc, #4]
       
    60 	bx      ip
       
    61 	.word   0           @ nop
       
    62 	.word   0x50515253  @ destination address
       
    63 
       
    64 	.code 16
       
    65 	.globl  fast_thumb_stub
       
    66 fast_thumb_stub:
       
    67 	push    {r6}
       
    68 	ldr     r6, [pc, #8]
       
    69 	mov     ip, r6
       
    70 	pop     {r6}
       
    71 	bx      ip
       
    72 	nop
       
    73 	.word   0x50515253  @ destination address
       
    74 
       
    75 	.code 16
       
    76 	.globl  fast_thumb_r3unused_stub
       
    77 fast_thumb_r3unused_stub:
       
    78 	ldr     r3, [pc, #4]
       
    79 	bx      r3
       
    80 	nop
       
    81 	nop
       
    82 	.word   0x50515253  @ destination address
       
    83 
       
    84 
       
    85