]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgcc/config/frv/frvend.c
Move crtstuff support to toplevel libgcc
[thirdparty/gcc.git] / libgcc / config / frv / frvend.c
CommitLineData
efb6037d 1/* Frv initialization file linked after all user modules
6bc9506f 2 Copyright (C) 1999, 2000, 2003, 2004, 2009 Free Software Foundation, Inc.
efb6037d 3 Contributed by Red Hat, Inc.
4
187b36cf 5 This file is part of GCC.
efb6037d 6
187b36cf 7 GCC is free software ; you can redistribute it and/or modify
efb6037d 8 it under the terms of the GNU General Public License as published by
6bc9506f 9 the Free Software Foundation; either version 3, or (at your option)
efb6037d 10 any later version.
11
187b36cf 12 GCC is distributed in the hope that it will be useful,
efb6037d 13 but WITHOUT ANY WARRANTY ; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
6bc9506f 17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
efb6037d 20
6bc9506f 21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
7de4f5f2 25
efb6037d 26#include "defaults.h"
27#include <stddef.h>
cf3f4012 28#include "../libgcc/unwind-dw2-fde.h"
efb6037d 29
30#ifdef __FRV_UNDERSCORE__
31#define UNDERSCORE "_"
32#else
33#define UNDERSCORE ""
34#endif
35
36#define FINI_SECTION_ZERO(SECTION, FLAGS, NAME) \
37__asm__ (".section " SECTION "," FLAGS "\n\t" \
38 ".globl " UNDERSCORE NAME "\n\t" \
39 ".type " UNDERSCORE NAME ",@object\n\t" \
40 ".p2align 2\n" \
41 UNDERSCORE NAME ":\n\t" \
42 ".word 0\n\t" \
43 ".previous")
44
45#define FINI_SECTION(SECTION, FLAGS, NAME) \
46__asm__ (".section " SECTION "," FLAGS "\n\t" \
47 ".globl " UNDERSCORE NAME "\n\t" \
48 ".type " UNDERSCORE NAME ",@object\n\t" \
49 ".p2align 2\n" \
50 UNDERSCORE NAME ":\n\t" \
51 ".previous")
52
53/* End of .ctor/.dtor sections that provides a list of constructors and
54 destructors to run. */
55
56FINI_SECTION_ZERO (".ctors", "\"aw\"", "__CTOR_END__");
57FINI_SECTION_ZERO (".dtors", "\"aw\"", "__DTOR_END__");
58
59/* End of .eh_frame section that provides all of the exception handling
60 tables. */
61
62FINI_SECTION_ZERO (".eh_frame", "\"aw\"", "__FRAME_END__");
63
3e7f6cce 64#if ! __FRV_FDPIC__
65/* In FDPIC, the linker itself generates this. */
efb6037d 66/* End of .rofixup section that provides a list of pointers that we
67 need to adjust. */
68
69FINI_SECTION (".rofixup", "\"a\"", "__ROFIXUP_END__");
3e7f6cce 70#endif /* __FRV_FDPIC__ */