linux64.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /* Definitions of target machine for GNU compiler,
  2. for 64 bit PowerPC linux.
  3. Copyright (C) 2000-2015 Free Software Foundation, Inc.
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU General Public License as published
  7. by the Free Software Foundation; either version 3, or (at your
  8. option) any later version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. License for more details.
  13. Under Section 7 of GPL version 3, you are granted additional
  14. permissions described in the GCC Runtime Library Exception, version
  15. 3.1, as published by the Free Software Foundation.
  16. You should have received a copy of the GNU General Public License and
  17. a copy of the GCC Runtime Library Exception along with this program;
  18. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. <http://www.gnu.org/licenses/>. */
  20. #ifndef RS6000_BI_ARCH
  21. #undef TARGET_64BIT
  22. #define TARGET_64BIT 1
  23. #define DEFAULT_ARCH64_P 1
  24. #define RS6000_BI_ARCH_P 0
  25. #else
  26. #define DEFAULT_ARCH64_P (TARGET_DEFAULT & MASK_64BIT)
  27. #define RS6000_BI_ARCH_P 1
  28. #endif
  29. #ifdef IN_LIBGCC2
  30. #undef TARGET_64BIT
  31. #ifdef __powerpc64__
  32. #define TARGET_64BIT 1
  33. #else
  34. #define TARGET_64BIT 0
  35. #endif
  36. #endif
  37. #undef TARGET_AIX
  38. #define TARGET_AIX TARGET_64BIT
  39. #ifdef HAVE_LD_NO_DOT_SYMS
  40. /* New ABI uses a local sym for the function entry point. */
  41. extern int dot_symbols;
  42. #undef DOT_SYMBOLS
  43. #define DOT_SYMBOLS dot_symbols
  44. #endif
  45. #define TARGET_PROFILE_KERNEL profile_kernel
  46. #define TARGET_USES_LINUX64_OPT 1
  47. #ifdef HAVE_LD_LARGE_TOC
  48. #undef TARGET_CMODEL
  49. #define TARGET_CMODEL rs6000_current_cmodel
  50. #define SET_CMODEL(opt) rs6000_current_cmodel = opt
  51. #else
  52. #define SET_CMODEL(opt) do {} while (0)
  53. #endif
  54. #undef PROCESSOR_DEFAULT
  55. #define PROCESSOR_DEFAULT PROCESSOR_POWER7
  56. #undef PROCESSOR_DEFAULT64
  57. #define PROCESSOR_DEFAULT64 PROCESSOR_POWER8
  58. /* We don't need to generate entries in .fixup, except when
  59. -mrelocatable or -mrelocatable-lib is given. */
  60. #undef RELOCATABLE_NEEDS_FIXUP
  61. #define RELOCATABLE_NEEDS_FIXUP \
  62. (rs6000_isa_flags & rs6000_isa_flags_explicit & OPTION_MASK_RELOCATABLE)
  63. #undef RS6000_ABI_NAME
  64. #define RS6000_ABI_NAME "linux"
  65. #define INVALID_64BIT "-m%s not supported in this configuration"
  66. #define INVALID_32BIT INVALID_64BIT
  67. #ifdef LINUX64_DEFAULT_ABI_ELFv2
  68. #define ELFv2_ABI_CHECK (rs6000_elf_abi != 1)
  69. #else
  70. #define ELFv2_ABI_CHECK (rs6000_elf_abi == 2)
  71. #endif
  72. #undef SUBSUBTARGET_OVERRIDE_OPTIONS
  73. #define SUBSUBTARGET_OVERRIDE_OPTIONS \
  74. do \
  75. { \
  76. if (!global_options_set.x_rs6000_alignment_flags) \
  77. rs6000_alignment_flags = MASK_ALIGN_NATURAL; \
  78. if (rs6000_isa_flags & OPTION_MASK_64BIT) \
  79. { \
  80. if (DEFAULT_ABI != ABI_AIX) \
  81. { \
  82. rs6000_current_abi = ABI_AIX; \
  83. error (INVALID_64BIT, "call"); \
  84. } \
  85. dot_symbols = !strcmp (rs6000_abi_name, "aixdesc"); \
  86. if (ELFv2_ABI_CHECK) \
  87. { \
  88. rs6000_current_abi = ABI_ELFv2; \
  89. if (dot_symbols) \
  90. error ("-mcall-aixdesc incompatible with -mabi=elfv2"); \
  91. } \
  92. if (rs6000_isa_flags & OPTION_MASK_RELOCATABLE) \
  93. { \
  94. rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE; \
  95. error (INVALID_64BIT, "relocatable"); \
  96. } \
  97. if (rs6000_isa_flags & OPTION_MASK_EABI) \
  98. { \
  99. rs6000_isa_flags &= ~OPTION_MASK_EABI; \
  100. error (INVALID_64BIT, "eabi"); \
  101. } \
  102. if (TARGET_PROTOTYPE) \
  103. { \
  104. target_prototype = 0; \
  105. error (INVALID_64BIT, "prototype"); \
  106. } \
  107. if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) == 0) \
  108. { \
  109. rs6000_isa_flags |= OPTION_MASK_POWERPC64; \
  110. error ("-m64 requires a PowerPC64 cpu"); \
  111. } \
  112. if ((rs6000_isa_flags_explicit \
  113. & OPTION_MASK_MINIMAL_TOC) != 0) \
  114. { \
  115. if (global_options_set.x_rs6000_current_cmodel \
  116. && rs6000_current_cmodel != CMODEL_SMALL) \
  117. error ("-mcmodel incompatible with other toc options"); \
  118. SET_CMODEL (CMODEL_SMALL); \
  119. } \
  120. else \
  121. { \
  122. if (!global_options_set.x_rs6000_current_cmodel) \
  123. SET_CMODEL (CMODEL_MEDIUM); \
  124. if (rs6000_current_cmodel != CMODEL_SMALL) \
  125. { \
  126. if (!global_options_set.x_TARGET_NO_FP_IN_TOC) \
  127. TARGET_NO_FP_IN_TOC \
  128. = rs6000_current_cmodel == CMODEL_MEDIUM; \
  129. if (!global_options_set.x_TARGET_NO_SUM_IN_TOC) \
  130. TARGET_NO_SUM_IN_TOC = 0; \
  131. } \
  132. } \
  133. } \
  134. else \
  135. { \
  136. if (!RS6000_BI_ARCH_P) \
  137. error (INVALID_32BIT, "32"); \
  138. if (TARGET_PROFILE_KERNEL) \
  139. { \
  140. TARGET_PROFILE_KERNEL = 0; \
  141. error (INVALID_32BIT, "profile-kernel"); \
  142. } \
  143. if (global_options_set.x_rs6000_current_cmodel) \
  144. { \
  145. SET_CMODEL (CMODEL_SMALL); \
  146. error (INVALID_32BIT, "cmodel"); \
  147. } \
  148. } \
  149. } \
  150. while (0)
  151. #undef ASM_DEFAULT_SPEC
  152. #undef ASM_SPEC
  153. #undef LINK_OS_LINUX_SPEC
  154. #ifndef RS6000_BI_ARCH
  155. #define ASM_DEFAULT_SPEC "-mppc64"
  156. #define ASM_SPEC "%(asm_spec64) %(asm_spec_common)"
  157. #define LINK_OS_LINUX_SPEC "%(link_os_linux_spec64)"
  158. #else
  159. #if DEFAULT_ARCH64_P
  160. #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}"
  161. #define ASM_SPEC "%{m32:%(asm_spec32)}%{!m32:%(asm_spec64)} %(asm_spec_common)"
  162. #define LINK_OS_LINUX_SPEC "%{m32:%(link_os_linux_spec32)}%{!m32:%(link_os_linux_spec64)}"
  163. #else
  164. #define ASM_DEFAULT_SPEC "-mppc%{m64:64}"
  165. #define ASM_SPEC "%{!m64:%(asm_spec32)}%{m64:%(asm_spec64)} %(asm_spec_common)"
  166. #define LINK_OS_LINUX_SPEC "%{!m64:%(link_os_linux_spec32)}%{m64:%(link_os_linux_spec64)}"
  167. #endif
  168. #endif
  169. #define ASM_SPEC32 "-a32 \
  170. %{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
  171. %{memb|msdata=eabi: -memb}"
  172. #define ASM_SPEC64 "-a64"
  173. #define ASM_SPEC_COMMON "%(asm_cpu) \
  174. %{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}" \
  175. ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
  176. #undef SUBSUBTARGET_EXTRA_SPECS
  177. #define SUBSUBTARGET_EXTRA_SPECS \
  178. { "asm_spec_common", ASM_SPEC_COMMON }, \
  179. { "asm_spec32", ASM_SPEC32 }, \
  180. { "asm_spec64", ASM_SPEC64 }, \
  181. { "link_os_linux_spec32", LINK_OS_LINUX_SPEC32 }, \
  182. { "link_os_linux_spec64", LINK_OS_LINUX_SPEC64 },
  183. #undef MULTILIB_DEFAULTS
  184. #if DEFAULT_ARCH64_P
  185. #define MULTILIB_DEFAULTS { "m64" }
  186. #else
  187. #define MULTILIB_DEFAULTS { "m32" }
  188. #endif
  189. #ifndef RS6000_BI_ARCH
  190. /* 64-bit PowerPC Linux always has a TOC. */
  191. #undef TARGET_TOC
  192. #define TARGET_TOC 1
  193. /* Some things from sysv4.h we don't do when 64 bit. */
  194. #undef OPTION_RELOCATABLE
  195. #define OPTION_RELOCATABLE 0
  196. #undef OPTION_EABI
  197. #define OPTION_EABI 0
  198. #undef OPTION_PROTOTYPE
  199. #define OPTION_PROTOTYPE 0
  200. #undef RELOCATABLE_NEEDS_FIXUP
  201. #define RELOCATABLE_NEEDS_FIXUP 0
  202. #endif
  203. /* We use glibc _mcount for profiling. */
  204. #define NO_PROFILE_COUNTERS 1
  205. #define PROFILE_HOOK(LABEL) \
  206. do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0)
  207. /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */
  208. #undef ADJUST_FIELD_ALIGN
  209. #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
  210. (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \
  211. ? 128 \
  212. : (TARGET_64BIT \
  213. && TARGET_ALIGN_NATURAL == 0 \
  214. && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode) \
  215. ? MIN ((COMPUTED), 32) \
  216. : (COMPUTED))
  217. /* PowerPC64 Linux increases natural record alignment to doubleword if
  218. the first field is an FP double, only if in power alignment mode. */
  219. #undef ROUND_TYPE_ALIGN
  220. #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
  221. ((TARGET_64BIT \
  222. && (TREE_CODE (STRUCT) == RECORD_TYPE \
  223. || TREE_CODE (STRUCT) == UNION_TYPE \
  224. || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
  225. && TARGET_ALIGN_NATURAL == 0) \
  226. ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
  227. : MAX ((COMPUTED), (SPECIFIED)))
  228. /* Use the default for compiling target libs. */
  229. #ifdef IN_TARGET_LIBS
  230. #undef TARGET_ALIGN_NATURAL
  231. #define TARGET_ALIGN_NATURAL 1
  232. #endif
  233. /* Indicate that jump tables go in the text section. */
  234. #undef JUMP_TABLES_IN_TEXT_SECTION
  235. #define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT
  236. /* The linux ppc64 ABI isn't explicit on whether aggregates smaller
  237. than a doubleword should be padded upward or downward. You could
  238. reasonably assume that they follow the normal rules for structure
  239. layout treating the parameter area as any other block of memory,
  240. then map the reg param area to registers. i.e. pad upward.
  241. Setting both of the following defines results in this behavior.
  242. Setting just the first one will result in aggregates that fit in a
  243. doubleword being padded downward, and others being padded upward.
  244. Not a bad idea as this results in struct { int x; } being passed
  245. the same way as an int. */
  246. #define AGGREGATE_PADDING_FIXED TARGET_64BIT
  247. #define AGGREGATES_PAD_UPWARD_ALWAYS 0
  248. /* Specify padding for the last element of a block move between
  249. registers and memory. FIRST is nonzero if this is the only
  250. element. */
  251. #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \
  252. (!(FIRST) ? upward : FUNCTION_ARG_PADDING (MODE, TYPE))
  253. /* Linux doesn't support saving and restoring 64-bit regs in a 32-bit
  254. process. */
  255. #define OS_MISSING_POWERPC64 !TARGET_64BIT
  256. #ifdef SINGLE_LIBC
  257. #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
  258. #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
  259. #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
  260. #else
  261. #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
  262. #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
  263. #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
  264. #endif
  265. /* Determine what functions are present at the runtime;
  266. this includes full c99 runtime and sincos. */
  267. #undef TARGET_LIBC_HAS_FUNCTION
  268. #define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function
  269. #undef TARGET_OS_CPP_BUILTINS
  270. #define TARGET_OS_CPP_BUILTINS() \
  271. do \
  272. { \
  273. if (TARGET_64BIT) \
  274. { \
  275. builtin_define ("__PPC__"); \
  276. builtin_define ("__PPC64__"); \
  277. builtin_define ("__powerpc__"); \
  278. builtin_define ("__powerpc64__"); \
  279. if (!DOT_SYMBOLS) \
  280. builtin_define ("_CALL_LINUX"); \
  281. builtin_assert ("cpu=powerpc64"); \
  282. builtin_assert ("machine=powerpc64"); \
  283. } \
  284. else \
  285. { \
  286. builtin_define_std ("PPC"); \
  287. builtin_define_std ("powerpc"); \
  288. builtin_assert ("cpu=powerpc"); \
  289. builtin_assert ("machine=powerpc"); \
  290. TARGET_OS_SYSV_CPP_BUILTINS (); \
  291. } \
  292. } \
  293. while (0)
  294. #undef CPP_OS_DEFAULT_SPEC
  295. #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
  296. #undef LINK_SHLIB_SPEC
  297. #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
  298. #undef LIB_DEFAULT_SPEC
  299. #define LIB_DEFAULT_SPEC "%(lib_linux)"
  300. #undef STARTFILE_DEFAULT_SPEC
  301. #define STARTFILE_DEFAULT_SPEC "%(startfile_linux)"
  302. #undef ENDFILE_DEFAULT_SPEC
  303. #define ENDFILE_DEFAULT_SPEC "%(endfile_linux)"
  304. #undef LINK_START_DEFAULT_SPEC
  305. #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
  306. #undef LINK_OS_DEFAULT_SPEC
  307. #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
  308. #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
  309. #ifdef LINUX64_DEFAULT_ABI_ELFv2
  310. #define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}"
  311. #else
  312. #define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
  313. #endif
  314. #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
  315. #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
  316. #if DEFAULT_LIBC == LIBC_UCLIBC
  317. #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
  318. #elif DEFAULT_LIBC == LIBC_GLIBC
  319. #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
  320. #else
  321. #error "Unsupported DEFAULT_LIBC"
  322. #endif
  323. #define GNU_USER_DYNAMIC_LINKER32 \
  324. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
  325. #define GNU_USER_DYNAMIC_LINKER64 \
  326. CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
  327. #undef DEFAULT_ASM_ENDIAN
  328. #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
  329. #define DEFAULT_ASM_ENDIAN " -mlittle"
  330. #define LINK_OS_LINUX_EMUL32 ENDIAN_SELECT(" -m elf32ppclinux", \
  331. " -m elf32lppclinux", \
  332. " -m elf32lppclinux")
  333. #define LINK_OS_LINUX_EMUL64 ENDIAN_SELECT(" -m elf64ppc", \
  334. " -m elf64lppc", \
  335. " -m elf64lppc")
  336. #else
  337. #define DEFAULT_ASM_ENDIAN " -mbig"
  338. #define LINK_OS_LINUX_EMUL32 ENDIAN_SELECT(" -m elf32ppclinux", \
  339. " -m elf32lppclinux", \
  340. " -m elf32ppclinux")
  341. #define LINK_OS_LINUX_EMUL64 ENDIAN_SELECT(" -m elf64ppc", \
  342. " -m elf64lppc", \
  343. " -m elf64ppc")
  344. #endif
  345. #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
  346. %{rdynamic:-export-dynamic} \
  347. -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}"
  348. #define LINK_OS_LINUX_SPEC64 LINK_OS_LINUX_EMUL64 " %{!shared: %{!static: \
  349. %{rdynamic:-export-dynamic} \
  350. -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}"
  351. #undef TOC_SECTION_ASM_OP
  352. #define TOC_SECTION_ASM_OP \
  353. (TARGET_64BIT \
  354. ? "\t.section\t\".toc\",\"aw\"" \
  355. : "\t.section\t\".got\",\"aw\"")
  356. #undef MINIMAL_TOC_SECTION_ASM_OP
  357. #define MINIMAL_TOC_SECTION_ASM_OP \
  358. (TARGET_64BIT \
  359. ? "\t.section\t\".toc1\",\"aw\"" \
  360. : ((TARGET_RELOCATABLE || flag_pic) \
  361. ? "\t.section\t\".got2\",\"aw\"" \
  362. : "\t.section\t\".got1\",\"aw\""))
  363. /* Must be at least as big as our pointer type. */
  364. #undef SIZE_TYPE
  365. #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int")
  366. #undef PTRDIFF_TYPE
  367. #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
  368. #undef WCHAR_TYPE
  369. #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
  370. #undef WCHAR_TYPE_SIZE
  371. #define WCHAR_TYPE_SIZE 32
  372. #undef RS6000_MCOUNT
  373. #define RS6000_MCOUNT "_mcount"
  374. #ifdef __powerpc64__
  375. /* _init and _fini functions are built from bits spread across many
  376. object files, each potentially with a different TOC pointer. For
  377. that reason, place a nop after the call so that the linker can
  378. restore the TOC pointer if a TOC adjusting call stub is needed. */
  379. #if DOT_SYMBOLS
  380. #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
  381. asm (SECTION_OP "\n" \
  382. " bl ." #FUNC "\n" \
  383. " nop\n" \
  384. " .previous");
  385. #else
  386. #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
  387. asm (SECTION_OP "\n" \
  388. " bl " #FUNC "\n" \
  389. " nop\n" \
  390. " .previous");
  391. #endif
  392. #endif
  393. /* FP save and restore routines. */
  394. #undef SAVE_FP_PREFIX
  395. #define SAVE_FP_PREFIX (TARGET_64BIT ? "._savef" : "_savefpr_")
  396. #undef SAVE_FP_SUFFIX
  397. #define SAVE_FP_SUFFIX ""
  398. #undef RESTORE_FP_PREFIX
  399. #define RESTORE_FP_PREFIX (TARGET_64BIT ? "._restf" : "_restfpr_")
  400. #undef RESTORE_FP_SUFFIX
  401. #define RESTORE_FP_SUFFIX ""
  402. /* Dwarf2 debugging. */
  403. #undef PREFERRED_DEBUGGING_TYPE
  404. #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
  405. /* This is how to declare the size of a function. */
  406. #undef ASM_DECLARE_FUNCTION_SIZE
  407. #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
  408. do \
  409. { \
  410. if (!flag_inhibit_size_directive) \
  411. { \
  412. fputs ("\t.size\t", (FILE)); \
  413. if (TARGET_64BIT && DOT_SYMBOLS) \
  414. putc ('.', (FILE)); \
  415. assemble_name ((FILE), (FNAME)); \
  416. fputs (",.-", (FILE)); \
  417. rs6000_output_function_entry (FILE, FNAME); \
  418. putc ('\n', (FILE)); \
  419. } \
  420. } \
  421. while (0)
  422. /* Return nonzero if this entry is to be written into the constant
  423. pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF
  424. or a CONST containing one of them. If -mfp-in-toc (the default),
  425. we also do this for floating-point constants. We actually can only
  426. do this if the FP formats of the target and host machines are the
  427. same, but we can't check that since not every file that uses
  428. the macros includes real.h. We also do this when we can write the
  429. entry into the TOC and the entry is not larger than a TOC entry. */
  430. #undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
  431. #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
  432. (TARGET_TOC \
  433. && (GET_CODE (X) == SYMBOL_REF \
  434. || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
  435. && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
  436. || GET_CODE (X) == LABEL_REF \
  437. || (GET_CODE (X) == CONST_INT \
  438. && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
  439. || (GET_CODE (X) == CONST_DOUBLE \
  440. && ((TARGET_64BIT \
  441. && (TARGET_MINIMAL_TOC \
  442. || (SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
  443. && ! TARGET_NO_FP_IN_TOC))) \
  444. || (!TARGET_64BIT \
  445. && !TARGET_NO_FP_IN_TOC \
  446. && !TARGET_RELOCATABLE \
  447. && SCALAR_FLOAT_MODE_P (GET_MODE (X)) \
  448. && BITS_PER_WORD == HOST_BITS_PER_INT)))))
  449. /* Select a format to encode pointers in exception handling data. CODE
  450. is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
  451. true if the symbol may be affected by dynamic relocations. */
  452. #undef ASM_PREFERRED_EH_DATA_FORMAT
  453. #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
  454. ((TARGET_64BIT || flag_pic || TARGET_RELOCATABLE) \
  455. ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \
  456. | (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4)) \
  457. : DW_EH_PE_absptr)
  458. /* For backward compatibility, we must continue to use the AIX
  459. structure return convention. */
  460. #undef DRAFT_V4_STRUCT_RET
  461. #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT)
  462. #ifdef TARGET_LIBC_PROVIDES_SSP
  463. /* ppc32 glibc provides __stack_chk_guard in -0x7008(2),
  464. ppc64 glibc provides it at -0x7010(13). */
  465. #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? -0x7010 : -0x7008)
  466. #endif
  467. #define POWERPC_LINUX
  468. /* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later. */
  469. #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
  470. #define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
  471. #endif
  472. /* Static stack checking is supported by means of probes. */
  473. #define STACK_CHECK_STATIC_BUILTIN 1
  474. /* The default value isn't sufficient in 64-bit mode. */
  475. #define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024)
  476. /* Software floating point support for exceptions and rounding modes
  477. depends on the C library in use. */
  478. #undef TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P
  479. #define TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P \
  480. rs6000_linux_float_exceptions_rounding_supported_p
  481. /* Support for TARGET_ATOMIC_ASSIGN_EXPAND_FENV without FPRs depends
  482. on glibc 2.19 or greater. */
  483. #if TARGET_GLIBC_MAJOR > 2 \
  484. || (TARGET_GLIBC_MAJOR == 2 && TARGET_GLIBC_MINOR >= 19)
  485. #define RS6000_GLIBC_ATOMIC_FENV 1
  486. #endif