From 0d5817b2d6b3d4a64a8cd336a8ef76dd001733c0 Mon Sep 17 00:00:00 2001
From: David Edelsohn <dje@gcc.gnu.org>
Date: Sun, 19 Feb 2006 13:46:12 -0500
Subject: [PATCH] xcoff.h (TARGET_ASM_OUTPUT_ANCHOR): Define.

        * config/rs6000/xcoff.h (TARGET_ASM_OUTPUT_ANCHOR): Define.
        * config/rs6000/rs6000.c (rs6000_xcoff_asm_output_anchor): Define.

From-SVN: r111275
---
 gcc/ChangeLog              |  9 +++++++--
 gcc/config/rs6000/rs6000.c | 11 +++++++++++
 gcc/config/rs6000/xcoff.h  |  1 +
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 974f56d147c5..0012dcbadc5f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-19  David Edelsohn  <edelsohn@gnu.org>
+
+	* config/rs6000/xcoff.h (TARGET_ASM_OUTPUT_ANCHOR): Define.
+	* config/rs6000/rs6000.c (rs6000_xcoff_asm_output_anchor): Define.
+
 2006-02-19  Daniel Berlin  <dberlin@dberlin.org>
 
 	* doc/invoke.texi: Document -fipa-pta.
@@ -32,13 +37,13 @@
 	* doc/contrib.texi (Contributors): Add classpath/libgcj hackers
 	who added new 4.1 features, bug fixes and integration support.
 
-2005-02-18  David Edelsohn  <edelsohn@gnu.org>
+2006-02-18  David Edelsohn  <edelsohn@gnu.org>
 
 	PR target/26350
 	* config/rs6000/rs6000.md (extenddftf2): Force 0.0 to validized
 	MEM for ABI_V4 pic.
 
-2005-02-18  Richard Sandiford  <richard@codesourcery.com>
+2006-02-18  Richard Sandiford  <richard@codesourcery.com>
 
 	* cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE.
 	* emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index a7b8f4068378..2b69a4852d6d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -625,6 +625,7 @@ static void rs6000_elf_encode_section_info (tree, rtx, int)
 #endif
 static bool rs6000_use_blocks_for_constant_p (enum machine_mode, rtx);
 #if TARGET_XCOFF
+static void rs6000_xcoff_asm_output_anchor (rtx);
 static void rs6000_xcoff_asm_globalize_label (FILE *, const char *);
 static void rs6000_xcoff_asm_init_sections (void);
 static void rs6000_xcoff_asm_named_section (const char *, unsigned int, tree);
@@ -18219,6 +18220,16 @@ rs6000_elf_end_indicate_exec_stack (void)
 #endif
 
 #if TARGET_XCOFF
+static void
+rs6000_xcoff_asm_output_anchor (rtx symbol)
+{
+  char buffer[100];
+
+  sprintf (buffer, "$ + " HOST_WIDE_INT_PRINT_DEC,
+	   SYMBOL_REF_BLOCK_OFFSET (symbol));
+  ASM_OUTPUT_DEF (asm_out_file, XSTR (symbol, 0), buffer);
+}
+
 static void
 rs6000_xcoff_asm_globalize_label (FILE *stream, const char *name)
 {
diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h
index e7560a86ab1c..abeab5a33362 100644
--- a/gcc/config/rs6000/xcoff.h
+++ b/gcc/config/rs6000/xcoff.h
@@ -80,6 +80,7 @@
 	       || (SCALAR_FLOAT_MODE_P (GET_MODE (X))			\
 		   && ! TARGET_NO_FP_IN_TOC)))))
 
+#define TARGET_ASM_OUTPUT_ANCHOR  rs6000_xcoff_asm_output_anchor
 #define TARGET_ASM_GLOBALIZE_LABEL  rs6000_xcoff_asm_globalize_label
 #define TARGET_ASM_INIT_SECTIONS  rs6000_xcoff_asm_init_sections
 #define TARGET_ASM_NAMED_SECTION  rs6000_xcoff_asm_named_section
-- 
GitLab