annotate libgcc/offloadstuff.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Specialized bits of code needed for the offloading tables.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 Copyright (C) 2014-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
9 version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
14 for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 Under Section 7 of GPL version 3, you are granted additional
kono
parents:
diff changeset
17 permissions described in the GCC Runtime Library Exception, version
kono
parents:
diff changeset
18 3.1, as published by the Free Software Foundation.
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 You should have received a copy of the GNU General Public License and
kono
parents:
diff changeset
21 a copy of the GCC Runtime Library Exception along with this program;
kono
parents:
diff changeset
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
kono
parents:
diff changeset
23 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 /* Target machine header files require this define. */
kono
parents:
diff changeset
26 #define IN_LIBGCC2
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* FIXME: Including auto-host is incorrect, but until we have
kono
parents:
diff changeset
29 identified the set of defines that need to go into auto-target.h,
kono
parents:
diff changeset
30 this will have to do. */
kono
parents:
diff changeset
31 #include "auto-host.h"
kono
parents:
diff changeset
32 #undef caddr_t
kono
parents:
diff changeset
33 #undef pid_t
kono
parents:
diff changeset
34 #undef rlim_t
kono
parents:
diff changeset
35 #undef ssize_t
kono
parents:
diff changeset
36 #undef vfork
kono
parents:
diff changeset
37 #include "tconfig.h"
kono
parents:
diff changeset
38 #include "tsystem.h"
kono
parents:
diff changeset
39 #include "coretypes.h"
kono
parents:
diff changeset
40 #include "tm.h"
kono
parents:
diff changeset
41 #include "libgcc_tm.h"
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 #if defined(HAVE_GAS_HIDDEN) && ENABLE_OFFLOADING == 1
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 #define OFFLOAD_FUNC_TABLE_SECTION_NAME ".gnu.offload_funcs"
kono
parents:
diff changeset
46 #define OFFLOAD_VAR_TABLE_SECTION_NAME ".gnu.offload_vars"
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 #ifdef CRT_BEGIN
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 const void *const __offload_func_table[0]
kono
parents:
diff changeset
51 __attribute__ ((__used__, visibility ("hidden"),
kono
parents:
diff changeset
52 section (OFFLOAD_FUNC_TABLE_SECTION_NAME))) = { };
kono
parents:
diff changeset
53 const void *const __offload_var_table[0]
kono
parents:
diff changeset
54 __attribute__ ((__used__, visibility ("hidden"),
kono
parents:
diff changeset
55 section (OFFLOAD_VAR_TABLE_SECTION_NAME))) = { };
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 #elif defined CRT_END
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 const void *const __offload_funcs_end[0]
kono
parents:
diff changeset
60 __attribute__ ((__used__, visibility ("hidden"),
kono
parents:
diff changeset
61 section (OFFLOAD_FUNC_TABLE_SECTION_NAME))) = { };
kono
parents:
diff changeset
62 const void *const __offload_vars_end[0]
kono
parents:
diff changeset
63 __attribute__ ((__used__, visibility ("hidden"),
kono
parents:
diff changeset
64 section (OFFLOAD_VAR_TABLE_SECTION_NAME))) = { };
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 #elif defined CRT_TABLE
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 extern const void *const __offload_func_table[];
kono
parents:
diff changeset
69 extern const void *const __offload_var_table[];
kono
parents:
diff changeset
70 extern const void *const __offload_funcs_end[];
kono
parents:
diff changeset
71 extern const void *const __offload_vars_end[];
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 const void *const __OFFLOAD_TABLE__[]
kono
parents:
diff changeset
74 __attribute__ ((__visibility__ ("hidden"))) =
kono
parents:
diff changeset
75 {
kono
parents:
diff changeset
76 &__offload_func_table, &__offload_funcs_end,
kono
parents:
diff changeset
77 &__offload_var_table, &__offload_vars_end
kono
parents:
diff changeset
78 };
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 #else /* ! CRT_BEGIN && ! CRT_END && ! CRT_TABLE */
kono
parents:
diff changeset
81 #error "One of CRT_BEGIN, CRT_END or CRT_TABLE must be defined."
kono
parents:
diff changeset
82 #endif
kono
parents:
diff changeset
83
kono
parents:
diff changeset
84 #endif