xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/aarch64/aarch64-netbsd.h (revision 33881f779a77dce6440bdc44610d94de75bebefe)
1 /* Definitions for AArch64 running NetBSD
2    Copyright (C) 2016-2017 Free Software Foundation, Inc.
3 
4    This file is part of GCC.
5 
6    GCC is free software; you can redistribute it and/or modify it
7    under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3, or (at your option)
9    any later version.
10 
11    GCC is distributed in the hope that it will be useful, but
12    WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    General Public License for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with GCC; see the file COPYING3.  If not see
18    <http://www.gnu.org/licenses/>.  */
19 
20 #ifndef GCC_AARCH64_NETBSD_H
21 #define GCC_AARCH64_NETBSD_H
22 
23 #define TARGET_LINKER_BIG_EMULATION "aarch64nbsdb"
24 #define TARGET_LINKER_LITTLE_EMULATION "aarch64nbsd"
25 
26 #if TARGET_BIG_ENDIAN_DEFAULT
27 #define TARGET_LINKER_EMULATION  TARGET_LINKER_BIG_EMULATION
28 #else
29 #define TARGET_LINKER_EMULATION  TARGET_LINKER_LITTLE_EMULATION
30 #endif
31 
32 #undef  SUBTARGET_EXTRA_LINK_SPEC
33 #define SUBTARGET_EXTRA_LINK_SPEC " -m" TARGET_LINKER_EMULATION
34 
35 #define NETBSD_ENTRY_POINT "__start"
36 
37 #define NETBSD_TARGET_LINK_SPEC  "%{h*}			\
38    -X %{mbig-endian:-EB -m " TARGET_LINKER_BIG_EMULATION "} \
39    %{mlittle-endian:-EL -m " TARGET_LINKER_LITTLE_EMULATION "} \
40    %(netbsd_link_spec)"
41 
42 #if TARGET_FIX_ERR_A53_835769_DEFAULT
43 #define CA53_ERR_835769_SPEC \
44   " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}"
45 #else
46 #define CA53_ERR_835769_SPEC \
47   " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}"
48 #endif
49 
50 #ifdef TARGET_FIX_ERR_A53_843419_DEFAULT
51 #define CA53_ERR_843419_SPEC \
52   " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}"
53 #else
54 #define CA53_ERR_843419_SPEC \
55   " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}"
56 #endif
57 
58 #undef  LINK_SPEC
59 #define LINK_SPEC NETBSD_LINK_SPEC_ELF 		\
60 		  NETBSD_TARGET_LINK_SPEC	\
61                   CA53_ERR_835769_SPEC		\
62                   CA53_ERR_843419_SPEC
63 
64 #undef TARGET_OS_CPP_BUILTINS
65 #define TARGET_OS_CPP_BUILTINS()		\
66   do						\
67     {						\
68       NETBSD_OS_CPP_BUILTINS_ELF();		\
69     }						\
70   while (0)
71 
72 #undef SUBTARGET_CPP_SPEC
73 #define SUBTARGET_CPP_SPEC NETBSD_CPP_SPEC
74 
75 #if 0
76 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
77 #endif
78 
79 #if 0
80 /* Uninitialized common symbols in non-PIE executables, even with
81    strong definitions in dependent shared libraries, will resolve
82    to COPY relocated symbol in the executable.  See PR65780.  */
83 #undef TARGET_BINDS_LOCAL_P
84 #define TARGET_BINDS_LOCAL_P default_binds_local_p_2
85 #endif
86 
87 #if 0
88 #undef MCOUNT_NAME
89 #define MCOUNT_NAME ".mcount"
90 #endif
91 
92 #undef EXTRA_SPECS
93 #define EXTRA_SPECS \
94   { "asm_cpu_spec",             ASM_CPU_SPEC }, \
95   NETBSD_SUBTARGET_EXTRA_SPECS
96 
97 #endif  /* GCC_AARCH64_NETBSD_H */
98