/* Definitions for PA_RISC with ELF format
- Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999-2024 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-
-/* A C expression whose value is RTL representing the location of the
- incoming return address at the beginning of any function, before the
- prologue. You only need to define this macro if you want to support
- call frame debugging information like that provided by DWARF 2. */
-#define INCOMING_RETURN_ADDR_RTX (gen_rtx_REG (word_mode, 2))
-#define DWARF_FRAME_RETURN_COLUMN (DWARF_FRAME_REGNUM (2))
-
-/* This macro chooses the encoding of pointers embedded in the exception
- handling sections. If at all possible, this should be defined such
- that the exception handling section will not require dynamic relocations,
- and so may be read-only.
-
- FIXME: We use DW_EH_PE_aligned to output a PLABEL constructor for
- global function pointers. */
-#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
- (CODE == 2 && GLOBAL ? DW_EH_PE_aligned : DW_EH_PE_absptr)
-
-/* Handle special EH pointer encodings. Absolute, pc-relative, and
- indirect are handled automatically. Since pc-relative encoding is
- not possible on the PA and we don't have the infrastructure for
- data relative encoding, we use aligned plabels for global function
- pointers. */
-#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
- do { \
- if (((ENCODING) & 0x0F) == DW_EH_PE_aligned) \
- { \
- fputs (integer_asm_op (SIZE, FALSE), FILE); \
- fputs ("P%", FILE); \
- assemble_name (FILE, XSTR (ADDR, 0)); \
- goto DONE; \
- } \
- } while (0)
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- LINUX_TARGET_OS_CPP_BUILTINS(); \
+ GNU_USER_TARGET_OS_CPP_BUILTINS(); \
builtin_assert ("machine=bigendian"); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
#undef CPP_SPEC
-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
-
-#undef LIB_SPEC
-#define LIB_SPEC \
- "%{pthread:-lpthread} \
- %{shared:-lgcc -lc} \
- %{!shared:%{mieee-fp:-lieee} %{shared-libgcc:-lgcc} %{profile:-lc_p}%{!profile:-lc}}"
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#undef ASM_SPEC
#define ASM_SPEC \
- "%{v:-V} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
+ ""
/* Define this for shared library support because it isn't in the main
linux.h file. */
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
#undef LINK_SPEC
#define LINK_SPEC "\
%{shared:-shared} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
%{static:-static}}"
/* glibc's profiling functions don't need gcc to allocate counters. */
-#define NO_PROFILE_COUNTERS 1
+#define NO_DEFERRED_PROFILE_COUNTERS 1
/* Define the strings used for the special svr4 .type and .size directives.
These strings generally do not vary from one system running svr4 to
file which includes this one. */
#undef STRING_ASM_OP
-#define STRING_ASM_OP ".stringz"
+#define STRING_ASM_OP "\t.stringz\t"
#define TEXT_SECTION_ASM_OP "\t.text"
#define DATA_SECTION_ASM_OP "\t.data"
#undef ASM_OUTPUT_ADDR_VEC_ELT
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
- if (TARGET_BIG_SWITCH) \
- fprintf (FILE, "\t.word .L%d\n", VALUE); \
- else \
- fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
+ fprintf (FILE, "\t.word .L%d\n", VALUE)
#undef ASM_OUTPUT_ADDR_DIFF_ELT
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- if (TARGET_BIG_SWITCH) \
- fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL); \
- else \
- fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
+ fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
/* Use the default. */
#undef ASM_OUTPUT_LABEL
does what we want (i.e. uses colons). It must be compatible with
ASM_GENERATE_INTERNAL_LABEL(), so do not define it here. */
+/* Use the default. */
+#undef ASM_OUTPUT_INTERNAL_LABEL
+
/* Use the default. */
#undef TARGET_ASM_GLOBALIZE_LABEL
/* Globalizing directive for a label. */
#define GLOBAL_ASM_OP ".globl "
/* FIXME: Hacked from the <elfos.h> one so that we avoid multiple
- labels in a function declaration (since pa.c seems determined to do
- it differently) */
+ labels in a function declaration (since pa.cc seems determined to do
+ it differently). */
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
{ \
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
+ pa_output_function_label (FILE); \
} \
while (0)
+/* Output function prologue for linux. */
+#undef TARGET_ASM_FUNCTION_PROLOGUE
+#define TARGET_ASM_FUNCTION_PROLOGUE pa_linux_output_function_prologue
+
/* As well as globalizing the label, we need to encode the label
to ensure a plabel is generated in an indirect call. */
do \
{ \
if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \
- hppa_encode_label (FUN); \
+ pa_encode_label (FUN); \
(*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
} \
while (0)
-/* Linux always uses gas. */
#undef TARGET_GAS
#define TARGET_GAS 1
+
+/* 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
+#define HAVE_sync_compare_and_swapdi 1
+
+/* Enable GNU stack notes. */
+
+#undef NEED_INDICATE_EXEC_STACK
+#define NEED_INDICATE_EXEC_STACK 1