diff options
Diffstat (limited to 'gcc/config/arm/lib1funcs.asm')
-rw-r--r-- | gcc/config/arm/lib1funcs.asm | 91 |
1 files changed, 75 insertions, 16 deletions
diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm index aac0ce1977f..ded20ffe7dd 100644 --- a/gcc/config/arm/lib1funcs.asm +++ b/gcc/config/arm/lib1funcs.asm @@ -1,7 +1,7 @@ @ libgcc1 routines for ARM cpu. @ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk) -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -44,7 +44,7 @@ Boston, MA 02111-1307, USA. */ #endif #ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ +#error __USER_LABEL_PREFIX__ not defined #endif /* ANSI concatenation macros. */ @@ -56,6 +56,16 @@ Boston, MA 02111-1307, USA. */ #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) +#ifdef __elf__ +#define __PLT__ (PLT) +#define TYPE(x) .type SYM(x),function +#define SIZE(x) .size SYM(x), . - SYM(x) +#else +#define __PLT__ +#define TYPE(x) +#define SIZE(x) +#endif + #ifdef L_udivsi3 dividend .req r0 @@ -66,9 +76,11 @@ ip .req r12 sp .req r13 lr .req r14 pc .req r15 + .text - .globl SYM (__udivsi3) - .align 0 + .globl SYM (__udivsi3) + TYPE (__udivsi3) + .align 0 SYM (__udivsi3): cmp divisor, #0 @@ -124,10 +136,12 @@ Lgot_result: Ldiv0: str lr, [sp, #-4]! - bl SYM (__div0) + bl SYM (__div0) __PLT__ mov r0, #0 @ about as wrong as it could be ldmia sp!, {pc}RETCOND + SIZE (__udivsi3) + #endif /* L_udivsi3 */ #ifdef L_umodsi3 @@ -140,8 +154,10 @@ ip .req r12 sp .req r13 lr .req r14 pc .req r15 + .text - .globl SYM (__umodsi3) + .globl SYM (__umodsi3) + TYPE (__umodsi3) .align 0 SYM (__umodsi3): @@ -210,10 +226,12 @@ Loop3: Ldiv0: str lr, [sp, #-4]! - bl SYM (__div0) + bl SYM (__div0) __PLT__ mov r0, #0 @ about as wrong as it could be ldmia sp!, {pc}RETCOND + SIZE (__umodsi3) + #endif /* L_umodsi3 */ #ifdef L_divsi3 @@ -226,8 +244,10 @@ ip .req r12 sp .req r13 lr .req r14 pc .req r15 + .text - .globl SYM (__divsi3) + .globl SYM (__divsi3) + TYPE (__divsi3) .align 0 SYM (__divsi3): @@ -291,10 +311,12 @@ Lgot_result: Ldiv0: str lr, [sp, #-4]! - bl SYM (__div0) + bl SYM (__div0) __PLT__ mov r0, #0 @ about as wrong as it could be ldmia sp!, {pc}RETCOND + SIZE (__divsi3) + #endif /* L_divsi3 */ #ifdef L_modsi3 @@ -307,8 +329,10 @@ ip .req r12 sp .req r13 lr .req r14 pc .req r15 + .text - .globl SYM (__modsi3) + .globl SYM (__modsi3) + TYPE (__modsi3) .align 0 SYM (__modsi3): @@ -388,38 +412,47 @@ Lgot_result: Ldiv0: str lr, [sp, #-4]! - bl SYM (__div0) + bl SYM (__div0) __PLT__ mov r0, #0 @ about as wrong as it could be ldmia sp!, {pc}RETCOND + SIZE (__modsi3) + #endif /* L_modsi3 */ #ifdef L_dvmd_tls - .globl SYM (__div0) + .globl SYM (__div0) + TYPE (__div0) .align 0 SYM (__div0): RET pc, lr + SIZE (__div0) + #endif /* L_divmodsi_tools */ #ifdef L_dvmd_lnx @ GNU/Linux division-by zero handler. Used in place of L_dvmd_tls #include <asm/unistd.h> + #define SIGFPE 8 @ cant use <asm/signal.h> as it @ contains too much C rubbish - .globl SYM (__div0) + .globl SYM (__div0) + TYPE (__div0) .align 0 SYM (__div0): stmfd sp!, {r1, lr} swi __NR_getpid cmn r0, #1000 - ldmgefd sp!, {r1, pc}RETCOND @ not much we can do + ldmhsfd sp!, {r1, pc}RETCOND @ not much we can do mov r1, #SIGFPE swi __NR_kill ldmfd sp!, {r1, pc}RETCOND + SIZE (__div0) + #endif /* L_dvmd_lnx */ /* These next two sections are here despite the fact that they contain Thumb @@ -439,10 +472,13 @@ SYM (__div0): .code 16 .macro call_via register .globl SYM (_call_via_\register) + TYPE (_call_via_\register) .thumb_func SYM (_call_via_\register): bx \register nop + + SIZE (_call_via_\register) .endm call_via r0 @@ -480,6 +516,7 @@ SYM (_call_via_\register): .align 0 .code 32 + .globl _arm_return _arm_return: ldmia r13!, {r12} bx r12 @@ -488,6 +525,7 @@ _arm_return: .macro interwork register .code 16 .globl SYM (_interwork_call_via_\register) + TYPE (_interwork_call_via_\register) .thumb_func SYM (_interwork_call_via_\register): bx pc @@ -500,6 +538,8 @@ SYM (_interwork_call_via_\register): stmeqdb r13!, {lr} adreq lr, _arm_return bx \register + + SIZE (_interwork_call_via_\register) .endm interwork r0 @@ -516,6 +556,25 @@ SYM (_interwork_call_via_\register): interwork fp interwork ip interwork sp - interwork lr - + + /* The lr case has to be handled a little differently...*/ + .code 16 + .globl SYM (_interwork_call_via_lr) + TYPE (_interwork_call_via_lr) + .thumb_func +SYM (_interwork_call_via_lr): + bx pc + nop + + .code 32 + .globl .Lchange_lr +.Lchange_lr: + tst lr, #1 + stmeqdb r13!, {lr} + mov ip, lr + adreq lr, _arm_return + bx ip + + SIZE (_interwork_call_via_lr) + #endif /* L_interwork_call_via_rX */ |