summaryrefslogtreecommitdiff
path: root/gcc/config/sparc
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-08 05:05:45 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-08 05:05:45 +0000
commit40af64cc998984ba36426f8dd329e27966ef01e7 (patch)
treed1ccb29c7e71fb530eaba0082fe695a30a47cf07 /gcc/config/sparc
parent395fe6d2b71f6c5aa02bded2521c2a4b0b2fd364 (diff)
downloadgcc-40af64cc998984ba36426f8dd329e27966ef01e7.tar.gz
PR target/21889
* target.h (gcc_target) <asm_out>: New field output_dwarf_dtprel. * target-def.h (TARGET_ASM_OUTPUT_DWARF_DTPREL): New macro. (TARGET_ASM_OUT): Add it. * doc/tm.texi (Debugging Info): Document it. * dwarf2out.c (output_loc_operands) <INTERNAL_DW_OP_tls_addr>: Test it instead of ASM_OUTPUT_DWARF_DTPREL. (loc_descriptor_from_tree_1) <VAR_DECL>: Likewise. * system.h: Poison ASM_OUTPUT_DWARF_DTPREL. * config/frv/frv-protos.h (frv_output_dwarf_dtprel): Delete. * config/frv/frv.c (frv_output_dwarf_dtprel): Make static and unused. (gen_inlined_tls_plt): Remove unused variable MEM. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to frv_output_dwarf_dtprel. * config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/i386/i386-protos.h (i386_output_dwarf_dtprel): Delete. * config/i386/i386.c (i386_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to i386_output_dwarf_dtprel. * config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): Delete. * config/ia64/ia64.c (ia64_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to ia64_output_dwarf_dtprel. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Delete. * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to rs6000_output_dwarf_dtprel * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/s390/s390-protos.h (s390_output_dwarf_dtprel): Delete. * config/s390/s390.c (s390_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to s390_output_dwarf_dtprel. * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/sparc/sol2-gas.h (TARGET_SUN_TLS): Define to 0. (TARGET_GNU_TLS): Define to 1. * config/sparc/sparc-protos.h (sparc_output_dwarf_dtprel): Delete. * config/sparc/sparc.c (sparc_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to sparc_output_dwarf_dtprel if TARGET_GNU_TLS only. * config/sparc/sparc.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config.gcc (sparc64-*-solaris2*): Include tm-dwarf2.h last. (sparc-*-solaris2*): Likewise on Solaris 7 and up. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100742 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sparc')
-rw-r--r--gcc/config/sparc/sol2-gas.h8
-rw-r--r--gcc/config/sparc/sol2.h2
-rw-r--r--gcc/config/sparc/sparc-protos.h1
-rw-r--r--gcc/config/sparc/sparc.c19
-rw-r--r--gcc/config/sparc/sparc.h10
5 files changed, 26 insertions, 14 deletions
diff --git a/gcc/config/sparc/sol2-gas.h b/gcc/config/sparc/sol2-gas.h
index 7e808f7acaf..942e39de8a4 100644
--- a/gcc/config/sparc/sol2-gas.h
+++ b/gcc/config/sparc/sol2-gas.h
@@ -3,3 +3,11 @@
/* Undefine this so that BNSYM/ENSYM pairs are emitted by STABS+. */
#undef NO_DBX_BNSYM_ENSYM
+
+/* Use GNU extensions to TLS support. */
+#ifdef HAVE_AS_TLS
+#undef TARGET_SUN_TLS
+#undef TARGET_GNU_TLS
+#define TARGET_SUN_TLS 0
+#define TARGET_GNU_TLS 1
+#endif
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index 1c68133a8c9..9b548c2d34c 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -72,7 +72,7 @@ Boston, MA 02111-1307, USA. */
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
- sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
+ sprintf ((LABEL), "*.L%s%lu", (PREFIX), (unsigned long)(NUM))
/* The native TLS-enabled assembler requires the directive #tls_object
to be put on objects in TLS sections (as of v7.1). This is not
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index 9c6e822cc76..c743f55c000 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -114,7 +114,6 @@ extern int v9_regcmp_p (enum rtx_code);
extern int sparc_check_64 (rtx, rtx);
extern rtx gen_df_reg (rtx, int);
extern int sparc_extra_constraint_check (rtx, int, int);
-extern void sparc_output_dwarf_dtprel (FILE*, int, rtx);
#endif /* RTX_CODE */
#endif /* __SPARC_PROTOS_H__ */
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 9d5edd18391..314895536db 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -363,6 +363,7 @@ static bool sparc_pass_by_reference (CUMULATIVE_ARGS *,
static int sparc_arg_partial_bytes (CUMULATIVE_ARGS *,
enum machine_mode, tree, bool);
static void sparc_dwarf_handle_frame_unspec (const char *, rtx, int);
+static void sparc_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
static void sparc_file_end (void);
#ifdef SUBTARGET_ATTRIBUTE_TABLE
const struct attribute_spec sparc_attribute_table[];
@@ -437,10 +438,11 @@ static bool fpu_option_set = false;
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN sparc_expand_builtin
-#ifdef HAVE_AS_TLS
+#if TARGET_TLS
#undef TARGET_HAVE_TLS
#define TARGET_HAVE_TLS true
#endif
+
#undef TARGET_CANNOT_FORCE_CONST_MEM
#define TARGET_CANNOT_FORCE_CONST_MEM sparc_cannot_force_const_mem
@@ -512,6 +514,11 @@ static bool fpu_option_set = false;
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION sparc_handle_option
+#if TARGET_GNU_TLS
+#undef TARGET_ASM_OUTPUT_DWARF_DTPREL
+#define TARGET_ASM_OUTPUT_DWARF_DTPREL sparc_output_dwarf_dtprel
+#endif
+
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END sparc_file_end
@@ -8451,10 +8458,10 @@ sparc_dwarf_handle_frame_unspec (const char *label,
dwarf2out_window_save (label);
}
-/* This is called from dwarf2out.c via ASM_OUTPUT_DWARF_DTPREL.
+/* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL.
We need to emit DTP-relative relocations. */
-void
+static void
sparc_output_dwarf_dtprel (FILE *file, int size, rtx x)
{
switch (size)
@@ -8472,8 +8479,10 @@ sparc_output_dwarf_dtprel (FILE *file, int size, rtx x)
fputs (")", file);
}
-static
-void sparc_file_end (void)
+/* Do whatever processing is required at the end of a file. */
+
+static void
+sparc_file_end (void)
{
/* If we haven't emitted the special PIC helper function, do so now. */
if (pic_helper_symbol_name[0] && !pic_helper_emitted_p)
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index aa3752c9d6f..73a64ca9463 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -2349,13 +2349,6 @@ extern int sparc_indent_opcode;
} \
} while (0)
-/* Emit a dtp-relative reference to a TLS variable. */
-
-#ifdef HAVE_AS_TLS
-#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \
- sparc_output_dwarf_dtprel (FILE, SIZE, X)
-#endif
-
#define SPARC_SYMBOL_REF_TLS_P(RTX) \
(GET_CODE (RTX) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (RTX) != 0)
@@ -2447,11 +2440,14 @@ extern int sparc_indent_opcode;
} \
}
+/* TLS support defaulting to original Sun flavor. GNU extensions
+ must be activated in separate configuration files. */
#ifdef HAVE_AS_TLS
#define TARGET_TLS 1
#else
#define TARGET_TLS 0
#endif
+
#define TARGET_SUN_TLS TARGET_TLS
#define TARGET_GNU_TLS 0