2 ; Port of uClibc for TMS320C6000 DSP architecture
4 ; Copyright (C) 2010 Texas Instruments Incorporated
5 ; Mark Salter <msalter@redhat.com>
7 ; This program is free software; you can redistribute it and/or modify it
8 ; under the terms of the GNU Library General Public License as published by
9 ; the Free Software Foundation; either version 2 of the License, or (at your
10 ; option) any later version.
12 ; This program is distributed in the hope that it will be useful, but WITHOUT
13 ; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
17 ; You should have received a copy of the GNU Library General Public License
18 ; along with this program; if not, see <http://www.gnu.org/licenses/>.
23 ;; On entry, the dynamic linker
30 ;; (4*(argc+3))(sp) NULL
31 ;; (4*(argc+4))(sp) envp[0]
35 ;; Register values are unspecified, except:
37 ;; A4 --> pointer to rtld fini rountine
38 ;; B14 --> pointer to application DSBT table
46 ;; * call __uClibc_main(
47 ;; int (*main)(int, char **, char **), A4
50 ;; void (*app_init)(void), B6
51 ;; void (*app_fini)(void), A8
52 ;; void (*rtld_fini)(void), B8
53 ;; void *stack_end) A10
55 MV .D2X A4,B8 ; rtld_fini
57 LDW .D2T1 *+B14($GOT(main)), A4
58 LDW .D2T2 *+B14($GOT(_init)), B6
60 || LDW .D2T1 *+B14($GOT(_fini)), A8
62 LDW .D2T2 *+B15(8),B4 ; argc
63 ADDAW .D1X B15,3,A6 ; **argv
64 MV .D1X B15,A10 ; stack_end
65 || ZERO .L1 A15 ; clear FP