]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/sparc/sysv4.h
svr4.h: Remove.
[thirdparty/gcc.git] / gcc / config / sparc / sysv4.h
CommitLineData
56149abc 1/* Target definitions for GNU compiler for SPARC running System V.4
00f88f07
DM
2 Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998, 2000, 2002, 2007, 2009,
3 2010
2398fb2a 4 Free Software Foundation, Inc.
e5e809f4 5 Contributed by Ron Guilmette (rfg@monkeys.com).
17fd0700 6
cc0651d2 7This file is part of GCC.
17fd0700 8
cc0651d2 9GCC is free software; you can redistribute it and/or modify
17fd0700 10it under the terms of the GNU General Public License as published by
2f83c7d6 11the Free Software Foundation; either version 3, or (at your option)
17fd0700
RS
12any later version.
13
cc0651d2 14GCC is distributed in the hope that it will be useful,
17fd0700
RS
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
2f83c7d6
NC
20along with GCC; see the file COPYING3. If not see
21<http://www.gnu.org/licenses/>. */
17fd0700 22
0f7a7be7
DB
23#ifndef TARGET_VERSION
24#define TARGET_VERSION fprintf (stderr, " (sparc ELF)");
25#endif
17fd0700 26
82d6b402
RH
27#undef SIZE_TYPE
28#define SIZE_TYPE (TARGET_ARCH64 ? "long unsigned int" : "unsigned int")
29
30#undef PTRDIFF_TYPE
31#define PTRDIFF_TYPE (TARGET_ARCH64 ? "long int" : "int")
32
57809813
JM
33/* Undefined some symbols which are appropriate only for typical svr4
34 systems, but not for the specific case of svr4 running on a
35 SPARC. */
19c3fc24 36
19c3fc24 37#undef INIT_SECTION_ASM_OP
68d69835 38#undef FINI_SECTION_ASM_OP
d48bc59a 39#undef READONLY_DATA_SECTION_ASM_OP
19c3fc24 40#undef TYPE_OPERAND_FMT
19c3fc24
RS
41#undef STRING_ASM_OP
42#undef COMMON_ASM_OP
43#undef SKIP_ASM_OP
ed493872 44#undef SET_ASM_OP /* Has no equivalent. See ASM_OUTPUT_DEF below. */
19c3fc24 45
1052937b
JW
46/* Pass -K to the assembler when PIC. */
47#undef ASM_SPEC
48#define ASM_SPEC \
51769cc0 49 "%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} %{Yd,*} \
24a4dd31 50 %{fpic|fPIC|fpie|fPIE:-K PIC} %(asm_cpu)"
1052937b 51
56149abc 52/* Define the names of various pseudo-op used by the SPARC/svr4 assembler.
19c3fc24
RS
53 Note that many of these are different from the typical pseudo-ops used
54 by most svr4 assemblers. That is probably due to a (misguided?) attempt
56149abc 55 to keep the SPARC/svr4 assembler somewhat compatible with the SPARC/SunOS
19c3fc24
RS
56 assembler. */
57
471b6f1b
HPN
58#define STRING_ASM_OP "\t.asciz\t"
59#define COMMON_ASM_OP "\t.common\t"
60#define SKIP_ASM_OP "\t.skip\t"
19c3fc24
RS
61
62/* This is the format used to print the second operand of a .type pseudo-op
56149abc 63 for the SPARC/svr4 assembler. */
19c3fc24 64
17fd0700
RS
65#define TYPE_OPERAND_FMT "#%s"
66
32686e40
JW
67#undef ASM_OUTPUT_CASE_LABEL
68#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
df9da8ad 69do { ASM_OUTPUT_ALIGN ((FILE), Pmode == SImode ? 2 : 3); \
4977bab6 70 (*targetm.asm_out.internal_label) ((FILE), PREFIX, NUM); \
32686e40
JW
71 } while (0)
72
19c3fc24
RS
73/* This is how to equate one symbol to another symbol. The syntax used is
74 `SYM1=SYM2'. Note that this is different from the way equates are done
75 with most svr4 assemblers, where the syntax is `.set SYM1,SYM2'. */
76
77#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
78 do { fprintf ((FILE), "\t"); \
79 assemble_name (FILE, LABEL1); \
80 fprintf (FILE, " = "); \
81 assemble_name (FILE, LABEL2); \
82 fprintf (FILE, "\n"); \
83 } while (0)
84
19c3fc24
RS
85/* A set of symbol definitions for assembly pseudo-ops which will
86 get us switched to various sections of interest. These are used
87 in all places where we simply want to switch to a section, and
88 *not* to push the previous section name onto the assembler's
89 section names stack (as we do often in dwarfout.c). */
17fd0700 90
471b6f1b
HPN
91#define TEXT_SECTION_ASM_OP "\t.section\t\".text\""
92#define DATA_SECTION_ASM_OP "\t.section\t\".data\""
93#define BSS_SECTION_ASM_OP "\t.section\t\".bss\""
d48bc59a 94#define READONLY_DATA_SECTION_ASM_OP "\t.section\t\".rodata\""
471b6f1b
HPN
95#define INIT_SECTION_ASM_OP "\t.section\t\".init\""
96#define FINI_SECTION_ASM_OP "\t.section\t\".fini\""
68d69835
JM
97
98/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
99
100 Note that we want to give these sections the SHF_WRITE attribute
101 because these sections will actually contain data (i.e. tables of
102 addresses of functions in the current root executable or shared library
103 file) and, in the case of a shared library, the relocatable addresses
104 will have to be properly resolved/relocated (and then written into) by
105 the dynamic linker when it actually attaches the given shared library
106 to the executing process. (Note that on SVR4, you may wish to use the
107 `-z text' option to the ELF linker, when building a shared library, as
108 an additional check that you are doing everything right. But if you do
109 use the `-z text' option when building a shared library, you will get
110 errors unless the .ctors and .dtors sections are marked as writable
111 via the SHF_WRITE attribute.) */
112
113#undef CTORS_SECTION_ASM_OP
471b6f1b 114#define CTORS_SECTION_ASM_OP "\t.section\t\".ctors\",#alloc,#write"
68d69835 115#undef DTORS_SECTION_ASM_OP
471b6f1b 116#define DTORS_SECTION_ASM_OP "\t.section\t\".dtors\",#alloc,#write"
7c262518 117
101d9529 118#undef ASM_OUTPUT_ALIGNED_BSS
0bb7aea5
DE
119#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
120 asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
2be15d0f
RH
121
122/* Override the name of the mcount profiling function. */
123
124#undef MCOUNT_FUNCTION
125#define MCOUNT_FUNCTION "*_mcount"