This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][Revised]: Fix PR42854 so weak linking works again on darwin
- From: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: mikestump at comcast dot net, jakub at redhat dot com
- Date: Sun, 14 Feb 2010 18:32:23 -0500
- Subject: [PATCH][Revised]: Fix PR42854 so weak linking works again on darwin
Fix PR 42854, caused by revision 155919, by insuring that
weak_finish_1 is called for weak_import. Bootstrapped without
regressions on x86_64-apple-darwin10. Okay for gcc trunk and
gcc 4.4.4?
Jack
2010-02-14 Jack Howarth <howarth@bromo.med.uc.edu>
Jakub Jelinek <jakub@redhat.com>
PR 42854
* gcc/darwin.h: (ASM_WEAKEN_DECL): Call weak_finish_1 for weak_import.
* gcc/darwin.c: (machopic_select_section): Same.
Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c (revision 156761)
+++ gcc/config/darwin.c (working copy)
@@ -1177,8 +1177,7 @@
{
bool weak = (DECL_P (decl)
&& DECL_WEAK (decl)
- && (lookup_attribute ("weak", DECL_ATTRIBUTES (decl))
- || ! lookup_attribute ("weak_import",
+ && (! lookup_attribute ("weak_import",
DECL_ATTRIBUTES (decl))));
section *base_section;
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h (revision 156761)
+++ gcc/config/darwin.h (working copy)
@@ -502,8 +502,7 @@
targetm.asm_out.globalize_label (FILE, NAME); \
if (DECL_EXTERNAL (DECL)) \
fputs ("\t.weak_reference ", FILE); \
- else if (! lookup_attribute ("weak", DECL_ATTRIBUTES (DECL)) \
- && lookup_attribute ("weak_import", DECL_ATTRIBUTES (DECL))) \
+ else if (lookup_attribute ("weak_import", DECL_ATTRIBUTES (DECL))) \
break; \
else if (TREE_PUBLIC (DECL)) \
fputs ("\t.weak_definition ", FILE); \