diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-16 12:36:38 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-16 12:36:38 +0000 |
commit | e216a9a3bc6ad3296d31f457da83c50bac029edc (patch) | |
tree | 6751b799774ee191126a39fcea165f308b606f08 /gcc/varasm.c | |
parent | 113c4c5ebda13008acb3e98d10d449aceb80a034 (diff) | |
download | gcc-e216a9a3bc6ad3296d31f457da83c50bac029edc.tar.gz |
2010-01-16 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 155960
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@155962 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index fab62198053..7ed59055745 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2337,13 +2337,15 @@ assemble_external (tree decl ATTRIBUTE_UNUSED) /* We want to output annotation for weak and external symbols at very last to check if they are references or not. */ - if (SUPPORTS_WEAK && DECL_WEAK (decl) + if (SUPPORTS_WEAK + && DECL_WEAK (decl) /* TREE_STATIC is a weird and abused creature which is not generally the right test for whether an entity has been locally emitted, inlined or otherwise not-really-extern, but for declarations that can be weak, it happens to be match. */ && !TREE_STATIC (decl) + && lookup_attribute ("weak", DECL_ATTRIBUTES (decl)) && value_member (decl, weak_decls) == NULL_TREE) weak_decls = tree_cons (NULL, decl, weak_decls); @@ -5227,6 +5229,9 @@ declare_weak (tree decl) warning (0, "weak declaration of %q+D not supported", decl); mark_weak (decl); + if (!lookup_attribute ("weak", DECL_ATTRIBUTES (decl))) + DECL_ATTRIBUTES (decl) + = tree_cons (get_identifier ("weak"), NULL, DECL_ATTRIBUTES (decl)); } static void |