URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [config/] [mips/] [irix-crti.asm] - Rev 282
Compare with Previous | Blame | View Log
/* Copyright (C) 2004, 2008 Free Software Foundation, Inc.This file is part of GCC.GCC is free software; you can redistribute it and/or modify it underthe terms of the GNU General Public License as published by the FreeSoftware Foundation; either version 3, or (at your option) any laterversion.GCC is distributed in the hope that it will be useful, but WITHOUT ANYWARRANTY; without even the implied warranty of MERCHANTABILITY orFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licensefor more details.Under Section 7 of GPL version 3, you are granted additionalpermissions described in the GCC Runtime Library Exception, version3.1, as published by the Free Software Foundation.You should have received a copy of the GNU General Public License anda copy of the GCC Runtime Library Exception along with this program;see the files COPYING3 and COPYING.RUNTIME respectively. If not, see<http://www.gnu.org/licenses/>. */.abicalls.set noreorder.set nomacro/* The GNU and SGI linkers differ in their implementation of -init and -fini.With the GNU linker, there can only be a single -init option, and thelinker simply sets DT_INIT to that value. gcc's initialization andfinalization code can go directly in .init, with the prologue andepilogue of the main initialization routine being provided by externalobject files (*crti.o and *crtn.o in this case).The SGI linker instead accepts several -init options. It will set DT_INITto a linker-created function (placed in .init) that calls each of the -initfunctions in turn. If there is any user code in .init, this linker-createdfunction will be placed after it. Note that such user code is not treatedspecially; it will only be called if the -init options arrange for it tobe called.In theory, the SGI model should allow the crti, crtn and intermediate codeto go in .init, just like it can with the GNU linker. However, doing thisseems to confuse the linker and triggers an internal error:ld32: FATAL 2 : Internal: at ../../ld/mips_code.c mips_code_fixup()text section overflow!(seen with MIPSpro 7.30). We therefore put everything in a special.gcc_init section instead. */.section .gcc_init,"ax",@progbits.globl __gcc_init__gcc_init:#if _MIPS_SIM == _ABIO32addiu $sp,$sp,-16sw $31,0($sp)#elsedaddiu $sp,$sp,-16sd $31,0($sp)sd $28,8($sp)#endif.section .gcc_fini,"ax",@progbits.globl __gcc_fini__gcc_fini:#if _MIPS_SIM == _ABIO32addiu $sp,$sp,-16sw $31,0($sp)#elsedaddiu $sp,$sp,-16sd $31,0($sp)sd $28,8($sp)#endif/* This object will typically be included in the final link for bothshared libraries and executable, and we need to hide the symbols toprevent possible symbol preemption warnings from the SGI linker. */.hidden __gcc_init.hidden __gcc_fini
