1 ##==============================================================================
7 ##==============================================================================
9 ## Copyright (c) 2000, Cygnus Solutions, A Red Hat Company
11 ## The authors hereby grant permission to use, copy, modify, distribute,
12 ## and license this software and its documentation for any purpose, provided
13 ## that existing copyright notices are retained in all copies and that this
14 ## notice is included verbatim in any distributions. No written agreement,
15 ## license, or royalty fee is required for any of the authorized uses.
16 ## Modifications to this software may be copyrighted by their authors
17 ## and need not follow the licensing terms described here, provided that
18 ## the new terms are clearly indicated on the first page of each file where
22 ##------------------------------------------------------------------------------
26 ##------------------------------------------------------------------------------
32 ori %29,%29,%lo(__stack)
34 lui %24,%hi(_edata) # get start of bss
35 ori %24,%24,%lo(_edata)
37 lui %25,%hi(_end) # get end of bss
40 beq %24,%25,.L0 # check if end and start are the same
41 # do nothing if no bss
44 sb %0,0(%24) # clear a byte and bump pointer
50 jal _main # call _main to run ctors/dtors
53 jal main # call main program
55 jal exit # all done, no need to return or
56 or %4,%0,%2 # exit with main's return value