source: rtems/c/src/lib/libbsp/powerpc/shared/start/rtems_crti.S @ 6ac7a12

Last change on this file since 6ac7a12 was 6ac7a12, checked in by cvs2git <rtems-devel@…>, on Mar 18, 2003 at 7:20:56 PM

This commit was manufactured by cvs2svn to create branch 'rtems-4-6-branch'.

Cherrypick from master 2003-03-18 19:20:55 UTC Joel Sherrill <joel.sherrill@…> '2003-03-18 Till Straumann <strauman@…>':

c/src/lib/libbsp/powerpc/shared/start/rtems_crti.S

  • Property mode set to 100644
File size: 830 bytes
Line 
1/* rtems_crti.S */
2#include <asm.h>
3#include <rtems/score/cpu.h>
4#include <libcpu/io.h>
5
6        /* terminate the __init() function and create
7         * a new head '_init' for use by RTEMS to
8         * invoke C++ global constructors
9         * NOTE: it is essential that this snippet
10         * is hooked between ecrti and crtbegin
11         *
12         * ecrti has the following .init section:
13         * __init:
14         *    stwu r1,-16(r1)
15         *    mflr r0
16         *    stw  r0,20(r1)
17         *
18         * The reason for this is that we want to call
19         * __eabi() at an early stage but prevent __eabi()
20         * from branching to __init (C++ exception init
21         * and global CTORs). Hence we make __init a no-op
22         * and create a new entry point:
23         */
24        .section ".init","ax"
25        .align 2
26        lwz             r0,r20(r1)
27        mtlr    r0
28        addi    r1,r1,16
29        blr
30        .globl  _init
31        .type   _init,@function
32_init:
33        stwu    r1,-16(r1)
34        mflr    r0
35        stw             r0,20(r1)       
Note: See TracBrowser for help on using the repository browser.