aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Edelsohn <edelsohn@gnu.org>2001-12-15 02:16:37 +0000
committerDavid Edelsohn <dje@gcc.gnu.org>2001-12-14 21:16:37 -0500
commitebd97b96f754b3a2e6d68ce4218b6c3b26edc5de (patch)
tree5ee17dfe93c6ab0ab66d11c128b044ba4074ffc9 /gcc
parent103c41c190a8fd22564b17aaa484a8e412a8a217 (diff)
downloadgcc-ebd97b96f754b3a2e6d68ce4218b6c3b26edc5de.zip
gcc-ebd97b96f754b3a2e6d68ce4218b6c3b26edc5de.tar.gz
gcc-ebd97b96f754b3a2e6d68ce4218b6c3b26edc5de.tar.bz2
rs6000.h (ASM_OUTPUT_DEF_FROM_DECLS): Handle DECL_WEAK for function descriptors.
* 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. From-SVN: r48027
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/rs6000/rs6000.h22
-rw-r--r--gcc/config/rs6000/xcoff.h21
3 files changed, 43 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7dbcf88..cfa921d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+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
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 627766a..b809d6b 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -2469,8 +2469,13 @@ extern int toc_initialized;
} \
}
-/* 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); \
@@ -2480,9 +2485,18 @@ do { \
{ \
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 \
{ \
diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h
index d5a6ff0..890ec4a 100644
--- a/gcc/config/rs6000/xcoff.h
+++ b/gcc/config/rs6000/xcoff.h
@@ -438,9 +438,6 @@ toc_section () \
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
@@ -454,9 +451,25 @@ toc_section () \
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