This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ARM TLS debug info


This patch causes GCC to output debug info for TLS variables on ARM by 
adding the necessary TARGET_ASM_OUTPUT_DWARF_DTPREL target hook.

Tested with no regressions with cross to arm-none-linux-gnueabi.  OK to 
commit?

The tests this fixes are the gdb.threads/tls* tests in the GDB testsuite.

2007-06-10  Joseph Myers  <joseph@codesourcery.com>

	* config/arm/arm.c (arm_output_dwarf_dtprel,
	TARGET_ASM_OUTPUT_DWARF_DTPREL): New.

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 125590)
+++ gcc/config/arm/arm.c	(working copy)
@@ -195,6 +195,7 @@
 static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode);
 static bool arm_cannot_copy_insn_p (rtx);
 static bool arm_tls_symbol_p (rtx x);
+static void arm_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
 
 
 /* Initialize the GCC target structure.  */
@@ -377,6 +378,11 @@
 #undef TARGET_CANNOT_FORCE_CONST_MEM
 #define TARGET_CANNOT_FORCE_CONST_MEM arm_tls_referenced_p
 
+#ifdef HAVE_AS_TLS
+#undef TARGET_ASM_OUTPUT_DWARF_DTPREL
+#define TARGET_ASM_OUTPUT_DWARF_DTPREL arm_output_dwarf_dtprel
+#endif
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Obstack for minipool constant handling.  */
@@ -16532,6 +16538,15 @@
   return TRUE;
 }
 
+static void
+arm_output_dwarf_dtprel (FILE *file, int size, rtx x)
+{
+  gcc_assert (size == 4);
+  fputs ("\t.word\t", file);
+  output_addr_const (file, x);
+  fputs ("(tlsldo)", file);
+}
+
 bool
 arm_output_addr_const_extra (FILE *fp, rtx x)
 {

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]