]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/vax/elf.h
Update copyright years.
[thirdparty/gcc.git] / gcc / config / vax / elf.h
CommitLineData
ec20cffb 1/* Target definitions for GNU compiler for VAX using ELF
83ffe9cd 2 Copyright (C) 2002-2023 Free Software Foundation, Inc.
0b55eafa 3 Contributed by Matt Thomas <matt@3am-software.com>
ec20cffb 4
e7d9d16b 5This file is part of GCC.
ec20cffb 6
e7d9d16b 7GCC is free software; you can redistribute it and/or modify
ec20cffb 8it under the terms of the GNU General Public License as published by
2f83c7d6 9the Free Software Foundation; either version 3, or (at your option)
ec20cffb
JT
10any later version.
11
e7d9d16b 12GCC is distributed in the hope that it will be useful,
ec20cffb
JT
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
2f83c7d6
NC
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
ec20cffb 20
c15c90bb
ZW
21#undef TARGET_ELF
22#define TARGET_ELF 1
23
ec20cffb
JT
24#undef REGISTER_PREFIX
25#undef REGISTER_NAMES
26#define REGISTER_PREFIX "%"
27#define REGISTER_NAMES \
0b55eafa 28 { "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", \
e552abe2
MR
29 "%r8", "%r9", "%r10", "%r11", "%ap", "%fp", "%sp", "%pc", \
30 "%psl" }
0b55eafa 31
ec20cffb
JT
32#undef SIZE_TYPE
33#define SIZE_TYPE "long unsigned int"
34
35#undef PTRDIFF_TYPE
36#define PTRDIFF_TYPE "long int"
37
38/* Profiling routine. */
191fe2bb
JT
39#undef VAX_FUNCTION_PROFILER_NAME
40#define VAX_FUNCTION_PROFILER_NAME "__mcount"
41
ec20cffb
JT
42/* Let's be re-entrant. */
43#undef PCC_STATIC_STRUCT_RETURN
44
ec20cffb
JT
45/* Before the prologue, the top of the frame is below the argument
46 count pushed by the CALLS and before the start of the saved registers. */
47#define INCOMING_FRAME_SP_OFFSET 0
48
ad8151b7
JW
49/* Offset from the frame pointer register value to the top of the stack. */
50#define FRAME_POINTER_CFA_OFFSET(FNDECL) 0
51
ec20cffb
JT
52/* We use R2-R5 (call-clobbered) registers for exceptions. */
53#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 2 : INVALID_REGNUM)
54
55/* Place the top of the stack for the DWARF2 EH stackadj value. */
56#define EH_RETURN_STACKADJ_RTX \
57 gen_rtx_MEM (SImode, \
0a81f074
RS
58 plus_constant (Pmode, \
59 gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
ec20cffb
JT
60 -4))
61
62/* Simple store the return handler into the call frame. */
63#define EH_RETURN_HANDLER_RTX \
64 gen_rtx_MEM (Pmode, \
0a81f074
RS
65 plus_constant (Pmode, \
66 gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
ec20cffb
JT
67 16))
68
69
ec20cffb
JT
70/* The VAX wants no space between the case instruction and the jump table. */
71#undef ASM_OUTPUT_BEFORE_CASE_LABEL
72#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE)
73
c5387660
JM
74#undef SUBTARGET_OVERRIDE_OPTIONS
75#define SUBTARGET_OVERRIDE_OPTIONS \
0b55eafa
JBG
76 do \
77 { \
0b55eafa
JBG
78 /* Turn off function CSE if we're doing PIC. */ \
79 if (flag_pic) \
80 flag_no_function_cse = 1; \
81 } \
ec20cffb
JT
82 while (0)
83
c4e75102
MT
84/* Don't allow *foo which foo is non-local */
85#define NO_EXTERNAL_INDIRECT_ADDRESS
86
87#undef VAX_CC1_AND_CC1PLUS_SPEC
88#define VAX_CC1_AND_CC1PLUS_SPEC \
89 "%{!fno-pic: \
90 %{!fpic: \
91 %{!fPIC:-fPIC}}}"
92
76a55358
MR
93/* Don't let the LTO compiler switch the PIC options off. */
94#define VAX_CC1_SPEC \
95 VAX_CC1_AND_CC1PLUS_SPEC \
96 " %{flinker-output=exec" \
97 ":%{no-pie:-flinker-output=exec;:-flinker-output=pie};" \
98 ":%{flinker-output=*}}" \
99 "%<flinker-output*"
100#define VAX_CC1PLUS_SPEC \
101 VAX_CC1_AND_CC1PLUS_SPEC
102
ec20cffb
JT
103/* VAX ELF is always gas; override the generic VAX ASM_SPEC. */
104
105#undef ASM_SPEC
c4e75102
MT
106#define ASM_SPEC "%{!fno-pic: %{!mno-asm-pic:-k}}"
107
108/* We want PCREL dwarf output. */
109#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
110 ((GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4)
111
112/* Emit a PC-relative relocation. */
113#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
114 do { \
115 fputs (integer_asm_op (SIZE, FALSE), FILE); \
116 fprintf (FILE, "%%pcrel%d(", SIZE * 8); \
117 assemble_name (FILE, LABEL); \
118 fputc (')', FILE); \
119 } while (0)