+2001-12-14 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.h (ASM_OUTPUT_DEF_FROM_DECLS): Handle
+ DECL_WEAK for function descriptors.
+ * config/rs6000/xcoff.h (HANDLE_PRAGMA_WEAK): Define if assembler
+ weak support present.
+ (ASM_WEAKEN_LABEL): Same.
+
2001-12-14 Kazu Hirata <kazu@hxi.com>
* config/h8300/h8300.md (anonymous pattern): Add a missing
} \
}
-/* This implementes the `alias' attribute. */
+#ifdef HAVE_GAS_WEAK
+#define RS6000_WEAK 1
+#else
+#define RS6000_WEAK 0
+#endif
+/* This implementes the `alias' attribute. */
#define ASM_OUTPUT_DEF_FROM_DECLS(FILE,decl,target) \
do { \
const char * alias = XSTR (XEXP (DECL_RTL (decl), 0), 0); \
{ \
if (TREE_PUBLIC (decl)) \
{ \
- fputs ("\t.globl .", FILE); \
- assemble_name (FILE, alias); \
- putc ('\n', FILE); \
+ if (RS6000_WEAK && DECL_WEAK (decl)) \
+ { \
+ fputs ("\t.weak .", FILE); \
+ assemble_name (FILE, alias); \
+ putc ('\n', FILE); \
+ } \
+ else \
+ { \
+ fputs ("\t.globl .", FILE); \
+ assemble_name (FILE, alias); \
+ putc ('\n', FILE); \
+ } \
} \
else \
{ \
fprintf ((FILE), ",%d\n", (SIZE)); \
} while (0)
-/* Used by definition of ASM_OUTPUT_DOUBLE_INT */
-#define DOUBLE_INT_ASM_OP "\t.llong "
-
/* This says how to output an assembler line
to define a local common symbol.
Alignment cannot be specified, but we can try to maintain
xcoff_bss_section_name); \
} while (0)
+/* Output a weak symbol, if weak support present. */
+#ifdef HAVE_GAS_WEAK
+#define HANDLE_PRAGMA_WEAK 1
+
+#define ASM_WEAKEN_LABEL(FILE, NAME) \
+ do \
+ { \
+ fputs ("\t.weak ", (FILE)); \
+ assemble_name ((FILE), (NAME)); \
+ fputc ('\n', (FILE)); \
+ } \
+ while (0)
+#endif /* HAVE_GAS_WEAK */
+
/* This is how we tell the assembler that two symbols have the same value. */
+#define SET_ASM_OP "\t.set "
-#define SET_ASM_OP "\t.set\t"
+/* Used by definition of ASM_OUTPUT_DOUBLE_INT */
+#define DOUBLE_INT_ASM_OP "\t.llong "
/* These are various definitions for DWARF output. They could just
use '.long' or '.word', but that aligns to a 4-byte boundary which