1 |
38 |
julius |
/* Definitions for AMD x86-64 running Linux-based GNU systems with ELF format.
|
2 |
|
|
Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
3 |
|
|
Contributed by Jan Hubicka <jh@suse.cz>, based on linux.h.
|
4 |
|
|
|
5 |
|
|
This file is part of GCC.
|
6 |
|
|
|
7 |
|
|
GCC is free software; you can redistribute it and/or modify
|
8 |
|
|
it under the terms of the GNU General Public License as published by
|
9 |
|
|
the Free Software Foundation; either version 3, or (at your option)
|
10 |
|
|
any later version.
|
11 |
|
|
|
12 |
|
|
GCC is distributed in the hope that it will be useful,
|
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 |
|
|
|
17 |
|
|
You should have received a copy of the GNU General Public License
|
18 |
|
|
along with GCC; see the file COPYING3. If not see
|
19 |
|
|
<http://www.gnu.org/licenses/>. */
|
20 |
|
|
|
21 |
|
|
#define TARGET_VERSION fprintf (stderr, " (x86-64 Linux/ELF)");
|
22 |
|
|
|
23 |
|
|
#define TARGET_OS_CPP_BUILTINS() \
|
24 |
|
|
do \
|
25 |
|
|
{ \
|
26 |
|
|
LINUX_TARGET_OS_CPP_BUILTINS(); \
|
27 |
|
|
} \
|
28 |
|
|
while (0)
|
29 |
|
|
|
30 |
|
|
#undef CPP_SPEC
|
31 |
|
|
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
|
32 |
|
|
|
33 |
|
|
/* The svr4 ABI for the i386 says that records and unions are returned
|
34 |
|
|
in memory. In the 64bit compilation we will turn this flag off in
|
35 |
|
|
override_options, as we never do pcc_struct_return scheme on this target. */
|
36 |
|
|
#undef DEFAULT_PCC_STRUCT_RETURN
|
37 |
|
|
#define DEFAULT_PCC_STRUCT_RETURN 1
|
38 |
|
|
|
39 |
|
|
/* We arrange for the whole %fs segment to map the tls area. */
|
40 |
|
|
#undef TARGET_TLS_DIRECT_SEG_REFS_DEFAULT
|
41 |
|
|
#define TARGET_TLS_DIRECT_SEG_REFS_DEFAULT MASK_TLS_DIRECT_SEG_REFS
|
42 |
|
|
|
43 |
|
|
/* Provide a LINK_SPEC. Here we provide support for the special GCC
|
44 |
|
|
options -static and -shared, which allow us to link things in one
|
45 |
|
|
of these three modes by applying the appropriate combinations of
|
46 |
|
|
options at link-time.
|
47 |
|
|
|
48 |
|
|
When the -shared link option is used a final link is not being
|
49 |
|
|
done. */
|
50 |
|
|
|
51 |
|
|
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
|
52 |
|
|
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
|
53 |
|
|
|
54 |
|
|
#undef LINK_SPEC
|
55 |
|
|
#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
|
56 |
|
|
%{shared:-shared} \
|
57 |
|
|
%{!shared: \
|
58 |
|
|
%{!static: \
|
59 |
|
|
%{rdynamic:-export-dynamic} \
|
60 |
|
|
%{m32:%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}} \
|
61 |
|
|
%{!m32:%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}} \
|
62 |
|
|
%{static:-static}}"
|
63 |
|
|
|
64 |
|
|
/* Similar to standard Linux, but adding -ffast-math support. */
|
65 |
|
|
#undef ENDFILE_SPEC
|
66 |
|
|
#define ENDFILE_SPEC \
|
67 |
|
|
"%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
|
68 |
|
|
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
|
69 |
|
|
|
70 |
|
|
#define MULTILIB_DEFAULTS { "m64" }
|
71 |
|
|
|
72 |
|
|
#undef NEED_INDICATE_EXEC_STACK
|
73 |
|
|
#define NEED_INDICATE_EXEC_STACK 1
|
74 |
|
|
|
75 |
|
|
#define MD_UNWIND_SUPPORT "config/i386/linux-unwind.h"
|
76 |
|
|
|
77 |
|
|
/* This macro may be overridden in i386/k*bsd-gnu.h. */
|
78 |
|
|
#define REG_NAME(reg) reg
|
79 |
|
|
|
80 |
|
|
#ifdef TARGET_LIBC_PROVIDES_SSP
|
81 |
|
|
/* i386 glibc provides __stack_chk_guard in %gs:0x14,
|
82 |
|
|
x86_64 glibc provides it in %fs:0x28. */
|
83 |
|
|
#define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14)
|
84 |
|
|
#endif
|