Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Remove broken weakref attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
Iain Buclaw committed Oct 16, 2012
1 parent 5e24c52 commit cd8bb6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 5 additions & 0 deletions gcc/d/ChangeLog
@@ -1,3 +1,8 @@
2012-10-16 Iain Buclaw <ibuclaw@ubuntu.com>

* d-objfile.cc(ObjectFile::outputThunk): Mark thunk as DECL_WEAK
rather than using weakref attribute.

2012-10-14 Iain Buclaw <ibuclaw@ubuntu.com>

* d-bi-attrs.h: Remove file.
Expand Down
13 changes: 6 additions & 7 deletions gcc/d/d-objfile.cc
Expand Up @@ -730,19 +730,18 @@ ObjectFile::outputThunk (tree thunk_decl, tree target_decl, int offset)
else
{
/* Backend will not emit thunks to external symbols unless the function is
being emitted in this compilation unit. So make generated thunks weakref
being emitted in this compilation unit. So make generated thunks weak
symbols for the methods they interface with. */
tree id = DECL_ASSEMBLER_NAME (target_decl);
tree attrs = tree_cons (NULL_TREE, build_string (IDENTIFIER_LENGTH (id),
IDENTIFIER_POINTER (id)), NULL_TREE);
attrs = tree_cons (get_identifier ("weakref"), attrs, NULL_TREE);

DECL_INITIAL (thunk_decl) = NULL_TREE;
DECL_EXTERNAL (thunk_decl) = 1;
TREE_ASM_WRITTEN (thunk_decl) = 0;
TREE_PRIVATE (thunk_decl) = 1;
TREE_PUBLIC (thunk_decl) = 0;
decl_attributes (&thunk_decl, attrs, 0);

/* Can't call declare_weak because it wants this to be TREE_PUBLIC,
and that isn't supported; and because it wants to add it to
the list of weak decls, which isn't helpful. */
DECL_WEAK (thunk_decl) = 1;

rest_of_decl_compilation (thunk_decl, 1, 0);
}
Expand Down

0 comments on commit cd8bb6d

Please sign in to comment.