95ce7613d5
2014-02-20 Chung-Lin Tang <cltang@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> gcc/ * config/nios2/nios2.md (unspec): Add UNSPEC_PIC_GOTOFF_SYM enum. * config/nios2/nios2.c (nios2_function_profiler): Add -fPIC (flag_pic == 2) support. (nios2_handle_custom_fpu_cfg): Fix warning parameter. (nios2_large_offset_p): New function. (nios2_unspec_reloc_p): Move up position, update to use nios2_large_offset_p. (nios2_unspec_address): Remove function. (nios2_unspec_offset): New function. (nios2_large_got_address): New function. (nios2_got_address): Add large offset support. (nios2_legitimize_tls_address): Update usage of removed and new functions. (nios2_symbol_binds_local_p): New function. (nios2_load_pic_address): Add -fPIC (flag_pic == 2) support. (nios2_legitimize_address): Update to use nios2_large_offset_p. (nios2_emit_move_sequence): Avoid legitimizing (const (unspec ...)). (nios2_print_operand): Merge H/L processing, add hiadj/lo processing for (const (unspec ...)). (nios2_unspec_reloc_name): Add UNSPEC_PIC_GOTOFF_SYM case. gcc/testsuite/ * gcc.target/nios2/biggot-1.c: New. * gcc.target/nios2/biggot-2.c: New. libgcc/ * config/nios2/t-nios2 (CRTSTUFF_T_CFLAGS): Add -mno-gpopt. * config/nios2/crti.S: Remove .file directive. * config/nios2/crtn.S: Likewise. From-SVN: r207965
86 lines
2.3 KiB
ArmAsm
86 lines
2.3 KiB
ArmAsm
/* Copyright (C) 2012-2014 Free Software Foundation, Inc.
|
|
Contributed by Jonah Graham (jgraham@altera.com).
|
|
Contributed by Mentor Graphics, Inc.
|
|
|
|
This file is free software; you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by the
|
|
Free Software Foundation; either version 3, or (at your option) any
|
|
later version.
|
|
|
|
This file is distributed in the hope that it will be useful, but
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
General Public License for more details.
|
|
|
|
Under Section 7 of GPL version 3, you are granted additional
|
|
permissions described in the GCC Runtime Library Exception, version
|
|
3.1, as published by the Free Software Foundation.
|
|
|
|
You should have received a copy of the GNU General Public License and
|
|
a 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/>. */
|
|
|
|
|
|
/* This file just make a stack frame for the contents of the .fini and
|
|
.init sections. Users may put any desired instructions in those
|
|
sections.
|
|
|
|
While technically any code can be put in the init and fini sections
|
|
most stuff will not work other than stuff which obeys the call frame
|
|
and ABI. All the call-preserved registers are saved, the call clobbered
|
|
registers should have been saved by the code calling init and fini.
|
|
|
|
See crtstuff.c for an example of code that inserts itself in the init
|
|
and fini sections.
|
|
|
|
See crt0.s for the code that calls init and fini. */
|
|
|
|
.section ".init"
|
|
.align 2
|
|
.global _init
|
|
_init:
|
|
addi sp, sp, -48
|
|
stw ra, 44(sp)
|
|
stw r23, 40(sp)
|
|
stw r22, 36(sp)
|
|
stw r21, 32(sp)
|
|
stw r20, 28(sp)
|
|
stw r19, 24(sp)
|
|
stw r18, 20(sp)
|
|
stw r17, 16(sp)
|
|
stw r16, 12(sp)
|
|
stw fp, 8(sp)
|
|
addi fp, sp, 8
|
|
#ifdef linux
|
|
nextpc r22
|
|
1: movhi r2, %hiadj(_gp_got - 1b)
|
|
addi r2, r2, %lo(_gp_got - 1b)
|
|
add r22, r22, r2
|
|
#endif
|
|
|
|
|
|
.section ".fini"
|
|
.align 2
|
|
.global _fini
|
|
_fini:
|
|
addi sp, sp, -48
|
|
stw ra, 44(sp)
|
|
stw r23, 40(sp)
|
|
stw r22, 36(sp)
|
|
stw r21, 32(sp)
|
|
stw r20, 28(sp)
|
|
stw r19, 24(sp)
|
|
stw r18, 20(sp)
|
|
stw r17, 16(sp)
|
|
stw r16, 12(sp)
|
|
stw fp, 8(sp)
|
|
addi fp, sp, 8
|
|
#ifdef linux
|
|
nextpc r22
|
|
1: movhi r2, %hiadj(_gp_got - 1b)
|
|
addi r2, r2, %lo(_gp_got - 1b)
|
|
add r22, r22, r2
|
|
#endif
|
|
|