https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68621
--- Comment #4 from vekumar at gcc dot gnu.org --- Even after initializing the array decl_binds_to_current_def_p (base_tree) return false when I set -fpic. ---Snip--- (1) bool decl_binds_to_current_def_p (const_tree decl) { gcc_assert (DECL_P (decl)); if (!targetm.binds_local_p (decl)) return false; (2) ---snip--- #if !TARGET_MACHO && !TARGET_DLLIMPORT_DECL_ATTRIBUTES /* For i386, common symbol is local only for non-PIE binaries. For x86-64, common symbol is local only for non-PIE binaries or linker supports copy reloc in PIE binaries. */ static bool ix86_binds_local_p (const_tree exp) { return default_binds_local_p_3 (exp, flag_shlib != 0, true, true, (!flag_pic || (TARGET_64BIT && HAVE_LD_PIE_COPYRELOC != 0))); } #endif ---snip--- And in default_binds_local_p_3 DECL_VISIBILITY (exp) is VISIBILITY_DEFAULT and shlib is set and it returns false (3) ---snip--- /* A symbol is local if the user has said explicitly that it will be, or if we have a definition for the symbol. We cannot infer visibility for undefined symbols. */ if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT && (TREE_CODE (exp) == FUNCTION_DECL || !extern_protected_data || DECL_VISIBILITY (exp) != VISIBILITY_PROTECTED) && (DECL_VISIBILITY_SPECIFIED (exp) || defined_locally)) return true; /* If PIC, then assume that any global name can be overridden by symbols resolved from other modules. */ if (shlib) return false; ---snip---