4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 675
16 * Mass Ave, Cambridge, MA 02139, USA.
20 /* code taken from leonccs 1.0 leon/src/libio/crt0.S
21 I don't know if this is available anymore, now that LECCS
22 is out. And I'm not sure if this source is in the LECCS distro :(
27 ! .global __start, _main
32 ! Start the real-time clock with a tick of 14 clocks
42 or %g2,%lo(edata),%g2 ! g2 = start of bss
44 or %g3,%lo(_end),%g3 ! g3 = end of bss
45 mov %g0,%g1 ! so std has two zeros
53 /* move data segment to proper location */
56 set (_endtext),%g2 ! g2 = start of data in aout file
57 set (_environ),%g4 ! g4 = start of where data should go
58 set (_edata),%g3 ! g3 = end of where data should go
59 subcc %g3, %g4, %g5 ! g5 = length of data
61 subcc %g4, %g2, %g0 ! need to relocate data ?
77 ! Should not return from uClibc main()
85 .global _environ ! first symbol in sdata