1 /* Copyright (C) 2012-2018 Free Software Foundation, Inc.
2 Contributed by Jonah Graham (jgraham@altera.com).
3 Contributed by Mentor Graphics, Inc.
5 This file is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 3, or (at your option) any
10 This file is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 Under Section 7 of GPL version 3, you are granted additional
16 permissions described in the GCC Runtime Library Exception, version
17 3.1, as published by the Free Software Foundation.
19 You should have received a copy of the GNU General Public License and
20 a copy of the GCC Runtime Library Exception along with this program;
21 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 <http://www.gnu.org/licenses/>. */
25 /* This file just make a stack frame for the contents of the .fini and
26 .init sections. Users may put any desired instructions in those
29 While technically any code can be put in the init and fini sections
30 most stuff will not work other than stuff which obeys the call frame
31 and ABI. All the call-preserved registers are saved, the call clobbered
32 registers should have been saved by the code calling init and fini.
34 See crtstuff.c for an example of code that inserts itself in the init
37 See crt0.s for the code that calls init and fini. */
57 1: movhi r2, %hiadj(_gp_got - 1b)
58 addi r2, r2, %lo(_gp_got - 1b)
81 1: movhi r2, %hiadj(_gp_got - 1b)
82 addi r2, r2, %lo(_gp_got - 1b)