1 /* Startup code for the microblaze platform, based on glibc 2.3.6, dl-machine.h */
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
21 .type _start,@function\n\
36 brlid r15,_dl_start\n\
40 .globl _dl_start_user\n\
41 .type _dl_start_user,@function\n\
44 addik r20,r20,_GLOBAL_OFFSET_TABLE_+8\n\
45 lwi r4,r20,_dl_skip_args@GOTOFF\n\
66 addik r15,r20,_dl_fini@GOTOFF\n\
71 .size _dl_start_user, . - _dl_start_user\n\
75 * Get a pointer to the argv array. On many platforms this can be just
76 * the address of the first argument, on other platforms we need to
77 * do something a little more subtle here.
79 #define GET_ARGV(ARGVP, ARGS) ARGVP = (((unsigned long*) ARGS)+1)
81 /* The ld.so library requires relocations */
82 #define ARCH_NEEDS_BOOTSTRAP_RELOCS
84 static __always_inline
85 void PERFORM_BOOTSTRAP_RELOC(ELF_RELOC *rpnt, unsigned long *reloc_addr,
86 unsigned long symbol_addr, unsigned long load_addr, attribute_unused Elf32_Sym *symtab)
89 switch (ELF_R_TYPE(rpnt->r_info))
91 case R_MICROBLAZE_REL:
93 *reloc_addr = load_addr + rpnt->r_addend;