annotate gcc/config/i386/gnu-user64.h @ 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 /* Definitions for AMD x86-64 using GNU userspace.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 Copyright (C) 2001-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 Contributed by Jan Hubicka <jh@suse.cz>, based on linux.h.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 This file is part of GCC.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 GCC is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
9 the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
10 any later version.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
15 GNU General Public License for more details.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 Under Section 7 of GPL version 3, you are granted additional
kono
parents:
diff changeset
18 permissions described in the GCC Runtime Library Exception, version
kono
parents:
diff changeset
19 3.1, as published by the Free Software Foundation.
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 You should have received a copy of the GNU General Public License and
kono
parents:
diff changeset
22 a copy of the GCC Runtime Library Exception along with this program;
kono
parents:
diff changeset
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
kono
parents:
diff changeset
24 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 /* Provide a LINK_SPEC. Here we provide support for the special GCC
kono
parents:
diff changeset
27 options -static and -shared, which allow us to link things in one
kono
parents:
diff changeset
28 of these three modes by applying the appropriate combinations of
kono
parents:
diff changeset
29 options at link-time.
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 When the -shared link option is used a final link is not being
kono
parents:
diff changeset
32 done. */
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 #if TARGET_64BIT_DEFAULT
kono
parents:
diff changeset
35 #define SPEC_32 "m16|m32"
kono
parents:
diff changeset
36 #if TARGET_BI_ARCH == 2
kono
parents:
diff changeset
37 #define SPEC_64 "m64"
kono
parents:
diff changeset
38 #define SPEC_X32 "m16|m32|m64:;"
kono
parents:
diff changeset
39 #else
kono
parents:
diff changeset
40 #define SPEC_64 "m16|m32|mx32:;"
kono
parents:
diff changeset
41 #define SPEC_X32 "mx32"
kono
parents:
diff changeset
42 #endif
kono
parents:
diff changeset
43 #else
kono
parents:
diff changeset
44 #define SPEC_32 "m64|mx32:;"
kono
parents:
diff changeset
45 #define SPEC_64 "m64"
kono
parents:
diff changeset
46 #define SPEC_X32 "mx32"
kono
parents:
diff changeset
47 #endif
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 #undef ASM_SPEC
kono
parents:
diff changeset
50 #define ASM_SPEC "%{" SPEC_32 ":--32} \
kono
parents:
diff changeset
51 %{" SPEC_64 ":--64} \
kono
parents:
diff changeset
52 %{" SPEC_X32 ":--x32} \
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
53 %{msse2avx:%{!mavx:-msse2avx}}"
111
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 #define GNU_USER_TARGET_LINK_SPEC \
kono
parents:
diff changeset
56 "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
kono
parents:
diff changeset
57 %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
kono
parents:
diff changeset
58 %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
kono
parents:
diff changeset
59 %{shared:-shared} \
kono
parents:
diff changeset
60 %{!shared: \
kono
parents:
diff changeset
61 %{!static: \
kono
parents:
diff changeset
62 %{!static-pie: \
kono
parents:
diff changeset
63 %{rdynamic:-export-dynamic} \
kono
parents:
diff changeset
64 %{" SPEC_32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \
kono
parents:
diff changeset
65 %{" SPEC_64 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \
kono
parents:
diff changeset
66 %{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}}} \
kono
parents:
diff changeset
67 %{static:-static} %{static-pie:-static -pie --no-dynamic-linker -z text}}"
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 #undef LINK_SPEC
kono
parents:
diff changeset
70 #define LINK_SPEC GNU_USER_TARGET_LINK_SPEC
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 #if TARGET_64BIT_DEFAULT
kono
parents:
diff changeset
73 #if TARGET_BI_ARCH == 2
kono
parents:
diff changeset
74 #define MULTILIB_DEFAULTS { "mx32" }
kono
parents:
diff changeset
75 #else
kono
parents:
diff changeset
76 #define MULTILIB_DEFAULTS { "m64" }
kono
parents:
diff changeset
77 #endif
kono
parents:
diff changeset
78 #else
kono
parents:
diff changeset
79 #define MULTILIB_DEFAULTS { "m32" }
kono
parents:
diff changeset
80 #endif
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 #ifdef TARGET_LIBC_PROVIDES_SSP
kono
parents:
diff changeset
83 /* i386 glibc provides __stack_chk_guard in %gs:0x14,
kono
parents:
diff changeset
84 x32 glibc provides it in %fs:0x18.
kono
parents:
diff changeset
85 x86_64 glibc provides it in %fs:0x28. */
kono
parents:
diff changeset
86 #define TARGET_THREAD_SSP_OFFSET \
kono
parents:
diff changeset
87 (TARGET_64BIT ? (TARGET_X32 ? 0x18 : 0x28) : 0x14)
kono
parents:
diff changeset
88
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
89 /* i386 glibc provides __private_ss in %gs:0x30.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
90 x32 glibc provides it in %fs:0x40.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
91 x86_64 glibc provides it in %fs:0x70. */
111
kono
parents:
diff changeset
92 #define TARGET_THREAD_SPLIT_STACK_OFFSET \
kono
parents:
diff changeset
93 (TARGET_64BIT ? (TARGET_X32 ? 0x40 : 0x70) : 0x30)
kono
parents:
diff changeset
94 #endif
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 #undef WCHAR_TYPE
kono
parents:
diff changeset
97 #define WCHAR_TYPE (TARGET_LP64 ? "int" : "long int")