Hi, The issue here is a pe-coff target specific thing that dllimported-symbols have an noninterposable, and an interposable part. The dllimport address itself is not interposable, but its stubbing function/var is.
So the hook binds_to_local has to return false for dllimport, nevertheless for clones we want that they getting interposable. Therefore - as suggested by Honza - we need to make explicit sure that we set DECL_DLLIMPORT_P() explicit to 0 in symtab. ChangeLog 2015-02-25 Kai Tietz <kti...@redhat.com> PR target/64212 * symtab.c (symtab::make_decl_local): Set DECL_IMPORT_P explicit to 0. (symtab::noninterposable_alias): Likewise. Tested for x86_64-w64-mingw32, i686-w64-mingw32, and x86_64-unknown-linux-gnu. Ok for apply? Regards, Kai Index: symtab.c =================================================================== --- symtab.c (Revision 220969) +++ symtab.c (Arbeitskopie) @@ -1165,6 +1165,7 @@ symtab_node::make_decl_local (void) DECL_VISIBILITY_SPECIFIED (decl) = 0; DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; TREE_PUBLIC (decl) = 0; + DECL_DLLIMPORT_P (decl) = 0; if (!DECL_RTL_SET_P (decl)) return; @@ -1534,7 +1535,6 @@ symtab_node::noninterposable_alias (symtab_node *n != flags_from_decl_or_type (fn->decl)) || DECL_ATTRIBUTES (node->decl) != DECL_ATTRIBUTES (fn->decl)) return false; - *(symtab_node **)data = node; return true; } @@ -1566,6 +1566,7 @@ symtab_node::noninterposable_alias (void) /* Otherwise create a new one. */ new_decl = copy_node (node->decl); + DECL_DLLIMPORT_P (new_decl) = 0; DECL_NAME (new_decl) = clone_function_name (node->decl, "localalias"); if (TREE_CODE (new_decl) == FUNCTION_DECL) DECL_STRUCT_FUNCTION (new_decl) = NULL;