]>
Commit | Line | Data |
---|---|---|
56149abc | 1 | /* Target definitions for GNU compiler for SPARC running System V.4 |
a945c346 | 2 | Copyright (C) 1991-2024 Free Software Foundation, Inc. |
e5e809f4 | 3 | Contributed by Ron Guilmette (rfg@monkeys.com). |
17fd0700 | 4 | |
cc0651d2 | 5 | This file is part of GCC. |
17fd0700 | 6 | |
cc0651d2 | 7 | GCC is free software; you can redistribute it and/or modify |
17fd0700 | 8 | it under the terms of the GNU General Public License as published by |
2f83c7d6 | 9 | the Free Software Foundation; either version 3, or (at your option) |
17fd0700 RS |
10 | any later version. |
11 | ||
cc0651d2 | 12 | GCC is distributed in the hope that it will be useful, |
17fd0700 RS |
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 | |
2f83c7d6 NC |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
17fd0700 | 20 | |
82d6b402 RH |
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 | ||
57809813 JM |
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. */ | |
19c3fc24 | 30 | |
19c3fc24 | 31 | #undef INIT_SECTION_ASM_OP |
68d69835 | 32 | #undef FINI_SECTION_ASM_OP |
d48bc59a | 33 | #undef READONLY_DATA_SECTION_ASM_OP |
19c3fc24 | 34 | #undef TYPE_OPERAND_FMT |
19c3fc24 RS |
35 | #undef STRING_ASM_OP |
36 | #undef COMMON_ASM_OP | |
37 | #undef SKIP_ASM_OP | |
ed493872 | 38 | #undef SET_ASM_OP /* Has no equivalent. See ASM_OUTPUT_DEF below. */ |
19c3fc24 | 39 | |
1052937b JW |
40 | /* Pass -K to the assembler when PIC. */ |
41 | #undef ASM_SPEC | |
42 | #define ASM_SPEC \ | |
12eb1a9c | 43 | "%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} \ |
428b3812 | 44 | %{" FPIE_OR_FPIC_SPEC ":-K PIC} %(asm_cpu)" |
1052937b | 45 | |
56149abc | 46 | /* Define the names of various pseudo-op used by the SPARC/svr4 assembler. |
19c3fc24 RS |
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 | |
56149abc | 49 | to keep the SPARC/svr4 assembler somewhat compatible with the SPARC/SunOS |
19c3fc24 RS |
50 | assembler. */ |
51 | ||
471b6f1b HPN |
52 | #define STRING_ASM_OP "\t.asciz\t" |
53 | #define COMMON_ASM_OP "\t.common\t" | |
54 | #define SKIP_ASM_OP "\t.skip\t" | |
19c3fc24 RS |
55 | |
56 | /* This is the format used to print the second operand of a .type pseudo-op | |
56149abc | 57 | for the SPARC/svr4 assembler. */ |
19c3fc24 | 58 | |
17fd0700 RS |
59 | #define TYPE_OPERAND_FMT "#%s" |
60 | ||
32686e40 JW |
61 | #undef ASM_OUTPUT_CASE_LABEL |
62 | #define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \ | |
df9da8ad | 63 | do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \ |
4977bab6 | 64 | (*targetm.asm_out.internal_label) ((FILE), PREFIX, NUM); \ |
32686e40 JW |
65 | } while (0) |
66 | ||
19c3fc24 RS |
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 | ||
19c3fc24 RS |
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). */ | |
17fd0700 | 84 | |
471b6f1b HPN |
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\"" | |
d48bc59a | 88 | #define READONLY_DATA_SECTION_ASM_OP "\t.section\t\".rodata\"" |
471b6f1b HPN |
89 | #define INIT_SECTION_ASM_OP "\t.section\t\".init\"" |
90 | #define FINI_SECTION_ASM_OP "\t.section\t\".fini\"" | |
68d69835 JM |
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 | |
471b6f1b | 108 | #define CTORS_SECTION_ASM_OP "\t.section\t\".ctors\",#alloc,#write" |
68d69835 | 109 | #undef DTORS_SECTION_ASM_OP |
471b6f1b | 110 | #define DTORS_SECTION_ASM_OP "\t.section\t\".dtors\",#alloc,#write" |
7c262518 | 111 | |
101d9529 | 112 | #undef ASM_OUTPUT_ALIGNED_BSS |
0bb7aea5 DE |
113 | #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ |
114 | asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) | |
2be15d0f RH |
115 | |
116 | /* Override the name of the mcount profiling function. */ | |
117 | ||
118 | #undef MCOUNT_FUNCTION | |
119 | #define MCOUNT_FUNCTION "*_mcount" |