]>
Commit | Line | Data |
---|---|---|
f25a48be | 1 | /* Target definitions for GNU compiler for SPARC running System V.4 |
f1717362 | 2 | Copyright (C) 1991-2016 Free Software Foundation, Inc. |
997d68fe | 3 | Contributed by Ron Guilmette (rfg@monkeys.com). |
bb0bd4ea | 4 | |
8457cf23 | 5 | This file is part of GCC. |
bb0bd4ea | 6 | |
8457cf23 | 7 | GCC is free software; you can redistribute it and/or modify |
bb0bd4ea | 8 | it under the terms of the GNU General Public License as published by |
038d1e19 | 9 | the Free Software Foundation; either version 3, or (at your option) |
bb0bd4ea | 10 | any later version. |
11 | ||
8457cf23 | 12 | GCC is distributed in the hope that it will be useful, |
bb0bd4ea | 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 | |
038d1e19 | 18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
bb0bd4ea | 20 | |
8e1581a1 | 21 | #undef SIZE_TYPE |
22 | #define SIZE_TYPE (TARGET_ARCH64 ? "long unsigned int" : "unsigned int") | |
23 | ||
24 | #undef PTRDIFF_TYPE | |
25 | #define PTRDIFF_TYPE (TARGET_ARCH64 ? "long int" : "int") | |
26 | ||
91276c47 | 27 | /* Undefined some symbols which are appropriate only for typical svr4 |
28 | systems, but not for the specific case of svr4 running on a | |
29 | SPARC. */ | |
5eb0d754 | 30 | |
5eb0d754 | 31 | #undef INIT_SECTION_ASM_OP |
b7c87ff2 | 32 | #undef FINI_SECTION_ASM_OP |
6cde52a2 | 33 | #undef READONLY_DATA_SECTION_ASM_OP |
5eb0d754 | 34 | #undef TYPE_OPERAND_FMT |
5eb0d754 | 35 | #undef STRING_ASM_OP |
36 | #undef COMMON_ASM_OP | |
37 | #undef SKIP_ASM_OP | |
da6029a6 | 38 | #undef SET_ASM_OP /* Has no equivalent. See ASM_OUTPUT_DEF below. */ |
5eb0d754 | 39 | |
c9123129 | 40 | /* Pass -K to the assembler when PIC. */ |
41 | #undef ASM_SPEC | |
42 | #define ASM_SPEC \ | |
5c8a1984 | 43 | "%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} \ |
e9abca4f | 44 | %{" FPIE_OR_FPIC_SPEC ":-K PIC} %(asm_cpu)" |
c9123129 | 45 | |
f25a48be | 46 | /* Define the names of various pseudo-op used by the SPARC/svr4 assembler. |
5eb0d754 | 47 | Note that many of these are different from the typical pseudo-ops used |
48 | by most svr4 assemblers. That is probably due to a (misguided?) attempt | |
f25a48be | 49 | to keep the SPARC/svr4 assembler somewhat compatible with the SPARC/SunOS |
5eb0d754 | 50 | assembler. */ |
51 | ||
327b40b7 | 52 | #define STRING_ASM_OP "\t.asciz\t" |
53 | #define COMMON_ASM_OP "\t.common\t" | |
54 | #define SKIP_ASM_OP "\t.skip\t" | |
5eb0d754 | 55 | |
56 | /* This is the format used to print the second operand of a .type pseudo-op | |
f25a48be | 57 | for the SPARC/svr4 assembler. */ |
5eb0d754 | 58 | |
bb0bd4ea | 59 | #define TYPE_OPERAND_FMT "#%s" |
60 | ||
40cf55b4 | 61 | #undef ASM_OUTPUT_CASE_LABEL |
62 | #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \ | |
6c64b217 | 63 | do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \ |
805e22b2 | 64 | (*targetm.asm_out.internal_label) ((FILE), PREFIX, NUM); \ |
40cf55b4 | 65 | } while (0) |
66 | ||
5eb0d754 | 67 | /* This is how to equate one symbol to another symbol. The syntax used is |
68 | `SYM1=SYM2'. Note that this is different from the way equates are done | |
69 | with most svr4 assemblers, where the syntax is `.set SYM1,SYM2'. */ | |
70 | ||
71 | #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ | |
72 | do { fprintf ((FILE), "\t"); \ | |
73 | assemble_name (FILE, LABEL1); \ | |
74 | fprintf (FILE, " = "); \ | |
75 | assemble_name (FILE, LABEL2); \ | |
76 | fprintf (FILE, "\n"); \ | |
77 | } while (0) | |
78 | ||
5eb0d754 | 79 | /* A set of symbol definitions for assembly pseudo-ops which will |
80 | get us switched to various sections of interest. These are used | |
81 | in all places where we simply want to switch to a section, and | |
82 | *not* to push the previous section name onto the assembler's | |
83 | section names stack (as we do often in dwarfout.c). */ | |
bb0bd4ea | 84 | |
327b40b7 | 85 | #define TEXT_SECTION_ASM_OP "\t.section\t\".text\"" |
86 | #define DATA_SECTION_ASM_OP "\t.section\t\".data\"" | |
87 | #define BSS_SECTION_ASM_OP "\t.section\t\".bss\"" | |
6cde52a2 | 88 | #define READONLY_DATA_SECTION_ASM_OP "\t.section\t\".rodata\"" |
327b40b7 | 89 | #define INIT_SECTION_ASM_OP "\t.section\t\".init\"" |
90 | #define FINI_SECTION_ASM_OP "\t.section\t\".fini\"" | |
b7c87ff2 | 91 | |
92 | /* Define the pseudo-ops used to switch to the .ctors and .dtors sections. | |
93 | ||
94 | Note that we want to give these sections the SHF_WRITE attribute | |
95 | because these sections will actually contain data (i.e. tables of | |
96 | addresses of functions in the current root executable or shared library | |
97 | file) and, in the case of a shared library, the relocatable addresses | |
98 | will have to be properly resolved/relocated (and then written into) by | |
99 | the dynamic linker when it actually attaches the given shared library | |
100 | to the executing process. (Note that on SVR4, you may wish to use the | |
101 | `-z text' option to the ELF linker, when building a shared library, as | |
102 | an additional check that you are doing everything right. But if you do | |
103 | use the `-z text' option when building a shared library, you will get | |
104 | errors unless the .ctors and .dtors sections are marked as writable | |
105 | via the SHF_WRITE attribute.) */ | |
106 | ||
107 | #undef CTORS_SECTION_ASM_OP | |
327b40b7 | 108 | #define CTORS_SECTION_ASM_OP "\t.section\t\".ctors\",#alloc,#write" |
b7c87ff2 | 109 | #undef DTORS_SECTION_ASM_OP |
327b40b7 | 110 | #define DTORS_SECTION_ASM_OP "\t.section\t\".dtors\",#alloc,#write" |
2cb4ac60 | 111 | |
4e5cf456 | 112 | #undef ASM_OUTPUT_ALIGNED_BSS |
a1a3ae5c | 113 | #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ |
114 | asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) | |
290fa2d3 | 115 | |
116 | /* Override the name of the mcount profiling function. */ | |
117 | ||
118 | #undef MCOUNT_FUNCTION | |
119 | #define MCOUNT_FUNCTION "*_mcount" |