|
Packit Service |
82fcde |
/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
This file is part of the GNU C Library.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
82fcde |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License as published by the Free Software Foundation; either
|
|
Packit Service |
82fcde |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
In addition to the permissions in the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License, the Free Software Foundation gives you unlimited
|
|
Packit Service |
82fcde |
permission to link the compiled version of this file with other
|
|
Packit Service |
82fcde |
programs, and to distribute those programs without any restriction
|
|
Packit Service |
82fcde |
coming from the use of this file. (The GNU Lesser General Public
|
|
Packit Service |
82fcde |
License restrictions do apply in other respects; for example, they
|
|
Packit Service |
82fcde |
cover modification of the file, and distribution when not linked
|
|
Packit Service |
82fcde |
into another program.)
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
Note that people who make modified versions of this file are not
|
|
Packit Service |
82fcde |
obligated to grant this special exception for their modified
|
|
Packit Service |
82fcde |
versions; it is their choice whether to do so. The GNU Lesser
|
|
Packit Service |
82fcde |
General Public License gives permission to release a modified
|
|
Packit Service |
82fcde |
version without this exception; this exception also makes it
|
|
Packit Service |
82fcde |
possible to release a modified version which carries forward this
|
|
Packit Service |
82fcde |
exception.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
82fcde |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
82fcde |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
82fcde |
Lesser General Public License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
License along with the GNU C Library. If not, see
|
|
Packit Service |
82fcde |
<http://www.gnu.org/licenses/>. */
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
.text
|
|
Packit Service |
82fcde |
.globl _start
|
|
Packit Service |
82fcde |
.type _start,@function
|
|
Packit Service |
82fcde |
_start:
|
|
Packit Service |
82fcde |
/* On entry the stack contains the following args:
|
|
Packit Service |
82fcde |
r1+0 - argc
|
|
Packit Service |
82fcde |
r1+4 - argv[0]
|
|
Packit Service |
82fcde |
...
|
|
Packit Service |
82fcde |
r1+4*(argc-1) - argv[argc-1]
|
|
Packit Service |
82fcde |
r1+4*argc - NULL
|
|
Packit Service |
82fcde |
r1+4*argc + 4 - envp[0]
|
|
Packit Service |
82fcde |
...
|
|
Packit Service |
82fcde |
NULL
|
|
Packit Service |
82fcde |
*/
|
|
Packit Service |
82fcde |
addk r3,r0,r0
|
|
Packit Service |
82fcde |
addk r5,r1,r0
|
|
Packit Service |
82fcde |
1:
|
|
Packit Service |
82fcde |
addik r5,r5,4
|
|
Packit Service |
82fcde |
lw r4,r5,r0
|
|
Packit Service |
82fcde |
bneid r4,1b
|
|
Packit Service |
82fcde |
addik r3,r3,1
|
|
Packit Service |
82fcde |
addik r6,r3,-1
|
|
Packit Service |
82fcde |
sw r6,r1,r0
|
|
Packit Service |
82fcde |
addik r7,r1,4
|
|
Packit Service |
82fcde |
addik r1,r1,-24
|
|
Packit Service |
82fcde |
#ifdef SHARED
|
|
Packit Service |
82fcde |
/* Setup PIC. */
|
|
Packit Service |
82fcde |
mfs r20,rpc
|
|
Packit Service |
82fcde |
addik r20,r20,_GLOBAL_OFFSET_TABLE_+8
|
|
Packit Service |
82fcde |
lwi r5,r20,main@GOT
|
|
Packit Service |
82fcde |
lwi r8,r20,__libc_csu_init@GOT
|
|
Packit Service |
82fcde |
lwi r9,r20,__libc_csu_fini@GOT
|
|
Packit Service |
82fcde |
brid __libc_start_main@PLT
|
|
Packit Service |
82fcde |
addk r10,r0,r0
|
|
Packit Service |
82fcde |
#else
|
|
Packit Service |
82fcde |
addik r5,r0,main
|
|
Packit Service |
82fcde |
addik r8,r0,__libc_csu_init
|
|
Packit Service |
82fcde |
addik r9,r0,__libc_csu_fini
|
|
Packit Service |
82fcde |
brid __libc_start_main
|
|
Packit Service |
82fcde |
addk r10,r0,r0
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
/* Define a symbol for the first piece of initialized data. */
|
|
Packit Service |
82fcde |
.data
|
|
Packit Service |
82fcde |
.globl __data_start
|
|
Packit Service |
82fcde |
__data_start:
|
|
Packit Service |
82fcde |
.long 0
|
|
Packit Service |
82fcde |
.weak data_start
|
|
Packit Service |
82fcde |
data_start = __data_start
|