pa-linux.h 4.91 KB
Newer Older
1
/* Definitions for PA_RISC with ELF format
2
   Copyright (C) 1999-2019 Free Software Foundation, Inc.
3

4
This file is part of GCC.
5

6
GCC is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 3, or (at your option)
9 10
any later version.

11
GCC is distributed in the hope that it will be useful,
12 13 14 15 16
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
17 18
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.  */
19 20


21 22 23 24
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS()		\
  do						\
    {						\
25
	GNU_USER_TARGET_OS_CPP_BUILTINS();	\
26 27 28 29 30
	builtin_assert ("machine=bigendian");	\
    }						\
  while (0)

#undef CPP_SPEC
31
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
32

33 34
#undef ASM_SPEC
#define ASM_SPEC \
35
  ""
36 37 38 39

/* Define this for shared library support because it isn't in the main
   linux.h file.  */

40 41
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"

42 43 44 45 46 47
#undef LINK_SPEC
#define LINK_SPEC "\
  %{shared:-shared} \
  %{!shared: \
    %{!static: \
      %{rdynamic:-export-dynamic} \
48
      -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
49 50 51
      %{static:-static}}"

/* glibc's profiling functions don't need gcc to allocate counters.  */
52
#define NO_DEFERRED_PROFILE_COUNTERS 1
53 54 55 56 57 58 59 60

/* Define the strings used for the special svr4 .type and .size directives.
   These strings generally do not vary from one system running svr4 to
   another, but if a given system (e.g. m88k running svr) needs to use
   different pseudo-op names for these, they may be overridden in the
   file which includes this one.  */

#undef STRING_ASM_OP
61
#define STRING_ASM_OP   "\t.stringz\t"
62 63 64 65 66

#define TEXT_SECTION_ASM_OP "\t.text"
#define DATA_SECTION_ASM_OP "\t.data"
#define BSS_SECTION_ASM_OP "\t.section\t.bss"

67
#define TARGET_ASM_FILE_START pa_linux_file_start
68

69 70 71 72
/* We want local labels to start with period if made with asm_fprintf.  */
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."

73 74 75 76 77 78 79 80
/* Define these to generate the Linux/ELF/SysV style of internal
   labels all the time - i.e. to be compatible with
   ASM_GENERATE_INTERNAL_LABEL in <elfos.h>.  Compare these with the
   ones in pa.h and note the lack of dollar signs in these.  FIXME:
   shouldn't we fix pa.h to use ASM_GENERATE_INTERNAL_LABEL instead? */

#undef ASM_OUTPUT_ADDR_VEC_ELT
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
81
  fprintf (FILE, "\t.word .L%d\n", VALUE)
82 83 84

#undef ASM_OUTPUT_ADDR_DIFF_ELT
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
85
  fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
86

87
/* Use the default.  */
88 89
#undef ASM_OUTPUT_LABEL

90
/* NOTE: (*targetm.asm_out.internal_label)() is defined for us by elfos.h, and
91 92 93
   does what we want (i.e. uses colons).  It must be compatible with
   ASM_GENERATE_INTERNAL_LABEL(), so do not define it here.  */

94
/* Use the default.  */
95 96 97
#undef ASM_OUTPUT_INTERNAL_LABEL

/* Use the default.  */
98
#undef TARGET_ASM_GLOBALIZE_LABEL
99
/* Globalizing directive for a label.  */
100
#define GLOBAL_ASM_OP ".globl "
101 102 103

/* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
   labels in a function declaration (since pa.c seems determined to do
104
   it differently).  */
105 106 107 108 109

#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)		\
  do								\
    {								\
110
      ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");	\
111
      ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));		\
112
      pa_output_function_label (FILE);				\
113 114 115
    }								\
  while (0)

116 117 118 119
/* Output function prologue for linux.  */
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE pa_linux_output_function_prologue

120 121 122 123 124 125 126 127
/* As well as globalizing the label, we need to encode the label
   to ensure a plabel is generated in an indirect call.  */

#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN)  		\
  do								\
    {								\
      if (!FUNCTION_NAME_P (XSTR (FUN, 0)))			\
128
	pa_encode_label (FUN);					\
129 130 131 132
      (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0));	\
    }								\
  while (0)

133 134
#undef TARGET_GAS
#define TARGET_GAS 1
135 136 137

#undef TARGET_SYNC_LIBCALL
#define TARGET_SYNC_LIBCALL 1
138 139 140 141 142 143 144 145 146 147

/* The SYNC operations are implemented as library functions, not
   INSN patterns.  As a result, the HAVE defines for the patterns are
   not defined.  We need to define them to generate the corresponding
   __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* and __GCC_ATOMIC_*_LOCK_FREE
   defines.  */

#define HAVE_sync_compare_and_swapqi 1
#define HAVE_sync_compare_and_swaphi 1
#define HAVE_sync_compare_and_swapsi 1
148
#define HAVE_sync_compare_and_swapdi 1
149

150 151 152
/* It's not possible to enable GNU_stack notes since the kernel needs
   an executable stack for signal returns and syscall restarts.  */

153
#undef NEED_INDICATE_EXEC_STACK
154
#define NEED_INDICATE_EXEC_STACK 0