sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "ARM EABI LICENCE.txt" sl@0: // which accompanies this distribution, and is available sl@0: // in kernel/eka/compsupp. sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // This file is part of usrt.lib and ksrt.lib. sl@0: // sl@0: // sl@0: sl@0: sl@0: extern "C" { sl@0: sl@0: // This calls each of the compiler constructed functions referenced from pi_ctorvec. sl@0: // These functions arrange to 'call' the appropriate constructor for the 'static' instance sl@0: // (in fact the call may be inlined). If the class of the instance has a destructor then sl@0: // compiler records that this object needs 'destructing' at 'exit' time. It does this by sl@0: // calling the function __cxa_atexit. We provide our own definition of this. sl@0: // sl@0: sl@0: sl@0: __asm void __cpp_initialize__aeabi_() sl@0: { sl@0: CODE32 sl@0: sl@0: IMPORT |SHT$$INIT_ARRAY$$Base| [WEAK] sl@0: IMPORT |SHT$$INIT_ARRAY$$Limit| [WEAK] sl@0: sl@0: // Export std::nothrow from here. sl@0: EXPORT _ZSt7nothrow sl@0: sl@0: STMFD r13!,{r3-r5,r14} sl@0: sl@0: LDR r4,base sl@0: LDR r5,limit sl@0: CMP r4,r5 sl@0: sl@0: // Exit if the array is empty. sl@0: LDMEQFD r13!,{r3-r5,pc} sl@0: sl@0: loop sl@0: LDR r0,[r4,#0] sl@0: ADD r0,r0,r4 sl@0: #ifdef __MARM_ARMV4__ sl@0: ADR r14,ret sl@0: MOV pc,r0 sl@0: #else sl@0: BLX r0 sl@0: #endif sl@0: sl@0: ret sl@0: ADD r4,r4,#4 sl@0: CMP r4,r5 sl@0: BNE loop sl@0: LDMFD r13!,{r3-r5,pc} sl@0: sl@0: base sl@0: DCD |SHT$$INIT_ARRAY$$Base| sl@0: limit sl@0: DCD |SHT$$INIT_ARRAY$$Limit| sl@0: sl@0: // cheat - defining this here saves a whole 4 bytes!!! - value is never used sl@0: _ZSt7nothrow sl@0: } sl@0: sl@0: sl@0: } // extern "C" sl@0: