[PATCH, committed] AIX section anchor support
David Edelsohn
dje@watson.ibm.com
Sun Feb 19 18:49:00 GMT 2006
AIX assembly language represents the address of the current
position as "$", not ".".
David
Bootstrapped and regression tested on powerpc-ibm-aix5.2.0.0
David
* config/rs6000/xcoff.h (TARGET_ASM_OUTPUT_ANCHOR): Define.
* config/rs6000/rs6000.c (rs6000_xcoff_asm_output_anchor): Define.
Index: xcoff.h
===================================================================
*** xcoff.h (revision 111264)
--- xcoff.h (working copy)
***************
*** 80,85 ****
--- 80,86 ----
|| (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
Index: rs6000.c
===================================================================
*** rs6000.c (revision 111264)
--- rs6000.c (working copy)
*************** static void rs6000_elf_encode_section_in
*** 625,630 ****
--- 625,631 ----
#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);
*************** rs6000_elf_end_indicate_exec_stack (void
*** 18219,18224 ****
--- 18220,18235 ----
#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)
{
More information about the Gcc-patches
mailing list