From c973d557baa81d9f9d55f1107f94d3904ba4ba6b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 12 Mar 2004 22:52:13 +0100 Subject: [PATCH] rs6000-protos.h (rs6000_output_dwarf_dtprel): Add prototype. * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Add prototype. * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): New. * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Define. From-SVN: r79408 --- gcc/ChangeLog | 7 +++++++ gcc/config/rs6000/rs6000-protos.h | 1 + gcc/config/rs6000/rs6000.c | 21 +++++++++++++++++++++ gcc/config/rs6000/rs6000.h | 7 +++++++ 4 files changed, 36 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba634503f89..75848cda66f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-03-12 Jakub Jelinek + + * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Add + prototype. + * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): New. + * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Define. + 2003-03-12 Andrew Pinski * config/rs6000/host-darwin.c (darwin_rs6000_gt_pch_use_address): diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 1121e309db9..5c778e15f05 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -198,6 +198,7 @@ extern int rs6000_register_move_cost (enum machine_mode, extern int rs6000_memory_move_cost (enum machine_mode, enum reg_class, int); extern bool rs6000_tls_referenced_p (rtx); extern int rs6000_tls_symbol_ref (rtx, enum machine_mode); +extern void rs6000_output_dwarf_dtprel (FILE*, int, rtx); /* Declare functions in rs6000-c.c */ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index d53c32eea93..55774649e0e 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2787,6 +2787,27 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, return NULL_RTX; } +/* This is called from dwarf2out.c via ASM_OUTPUT_DWARF_DTPREL. + We need to emit DTP-relative relocations. */ + +void +rs6000_output_dwarf_dtprel (FILE *file, int size, rtx x) +{ + switch (size) + { + case 4: + fputs ("\t.long\t", file); + break; + case 8: + fputs (DOUBLE_INT_ASM_OP, file); + break; + default: + abort (); + } + output_addr_const (file, x); + fputs ("@dtprel+0x8000", file); +} + /* Construct the SYMBOL_REF for the tls_get_addr function. */ static GTY(()) rtx rs6000_tls_symbol; diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index d520cb64efd..aceb56d4ffb 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -232,6 +232,13 @@ extern int target_flags; #define TARGET_UPDATE (! TARGET_NO_UPDATE) #define TARGET_FUSED_MADD (! TARGET_NO_FUSED_MADD) +/* Emit a dtp-relative reference to a TLS variable. */ + +#ifdef HAVE_AS_TLS +#define ASM_OUTPUT_DWARF_DTPREL(FILE, SIZE, X) \ + rs6000_output_dwarf_dtprel (FILE, SIZE, X) +#endif + #ifndef HAVE_AS_TLS #define HAVE_AS_TLS 0 #endif