diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 974f56d147c5a7bf007b0f1d3de5e84a05cf0866..0012dcbadc5f53c04e7180c7c528bb4b2a4c3905 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 a7b8f4068378041ab69420b18804cce830c5c4e3..2b69a4852d6dcdba59c4721275974873371e720d 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 e7560a86ab1cbe5cdcb376563a6425873d1ea93c..abeab5a33362e69b9208654f8c6bbf7f0d6f3f4b 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