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]

S/390 [3.3]: Backport ASM_OUTPUT_DWARF_DTPREL


Hello,

this patch backports the ASM_OUTPUT_DWARF_DTPREL macro
from CVS head to the 3.3 branch; without this, gdb will
not be able to handle thread-local variables.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux,
verified using the gdb testsuite that TLS now works.
Committed to the 3.3 branch.

Bye,
Ulrich

ChangeLog:

	* config/s390/s390-protos.h (s390_output_dwarf_dtprel): Declare.
	* config/s390/s390.c (s390_output_dwarf_dtprel): New function.
	* config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Define.

Index: gcc/config/s390/s390-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390-protos.h,v
retrieving revision 1.21.2.3
diff -c -p -r1.21.2.3 s390-protos.h
*** gcc/config/s390/s390-protos.h	27 Jun 2003 21:15:32 -0000	1.21.2.3
--- gcc/config/s390/s390-protos.h	31 Oct 2003 16:19:16 -0000
*************** extern void s390_output_constant_pool PA
*** 79,84 ****
--- 79,85 ----
  extern void s390_trampoline_template PARAMS ((FILE *));
  extern void s390_initialize_trampoline PARAMS ((rtx, rtx, rtx));
  extern rtx s390_gen_rtx_const_DI PARAMS ((int, int));
+ extern void s390_output_dwarf_dtprel PARAMS ((FILE *, int, rtx));
  extern rtx s390_simplify_dwarf_addr PARAMS ((rtx));
  extern void s390_machine_dependent_reorg PARAMS ((rtx));
  #endif /* RTX_CODE */
Index: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.70.2.11
diff -c -p -r1.70.2.11 s390.c
*** gcc/config/s390/s390.c	27 Jun 2003 21:15:32 -0000	1.70.2.11
--- gcc/config/s390/s390.c	31 Oct 2003 16:19:18 -0000
*************** s390_expand_cmpstr (target, op0, op1, le
*** 2943,2948 ****
--- 2943,2972 ----
  #endif
  }
  
+ /* This is called from dwarf2out.c via ASM_OUTPUT_DWARF_DTPREL.
+    We need to emit DTP-relative relocations.  */
+ 
+ void
+ s390_output_dwarf_dtprel (file, size, x)
+      FILE *file;
+      int size;
+      rtx x;
+ {
+   switch (size)
+     {
+     case 4:
+       fputs ("\t.long\t", file);
+       break;
+     case 8:
+       fputs ("\t.quad\t", file);
+       break;
+     default:
+       abort ();
+     }
+   output_addr_const (file, x);
+   fputs ("@DTPOFF", file);
+ }
+ 
  /* In the name of slightly smaller debug output, and to cater to
     general assembler losage, recognize various UNSPEC sequences
     and turn them back into a direct symbol reference.  */
Index: gcc/config/s390/s390.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.h,v
retrieving revision 1.53.2.8
diff -c -p -r1.53.2.8 s390.h
*** gcc/config/s390/s390.h	27 Jun 2003 21:15:33 -0000	1.53.2.8
--- gcc/config/s390/s390.h	31 Oct 2003 16:19:19 -0000
*************** extern int flag_pic; 
*** 979,984 ****
--- 982,993 ----
    "%f8",  "%f10", "%f12", "%f14", "%f9", "%f11", "%f13", "%f15",	\
    "%ap",  "%cc",  "%fp"							\
  }
+ 
+ /* Emit a dtp-relative reference to a TLS variable.  */
+ #ifdef HAVE_AS_TLS
+ #define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \
+   s390_output_dwarf_dtprel (FILE, SIZE, X)
+ #endif
  
  /* Print operand X (an rtx) in assembler syntax to file FILE.  */
  #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


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