+2019-10-07 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (machopic_output_indirection): Don't put
+ hidden symbol indirections into the .data section, use the
+ non-lazy symbol pointers section as normal.
+ (darwin_encode_section_info): Record if a symbol is hidden.
+ * config/darwin.h (MACHO_SYMBOL_FLAG_HIDDEN_VIS): New.
+ (MACHO_SYMBOL_HIDDEN_VIS_P): New.
+
2019-10-07 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.c (machopic_symbol_defined_p): Use symbol flag
machopic_output_stub (asm_out_file, sym, stub);
}
else if (! indirect_data (symbol)
+ && ! MACHO_SYMBOL_HIDDEN_VIS_P (symbol)
&& (machopic_symbol_defined_p (symbol)
|| SYMBOL_REF_LOCAL_P (symbol)))
{
if (VAR_P (decl))
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_VARIABLE;
+ /* For Darwin, if we have specified visibility and it's not the default
+ that's counted 'hidden'. */
+ if (DECL_VISIBILITY_SPECIFIED (decl)
+ && DECL_VISIBILITY (decl) != VISIBILITY_DEFAULT)
+ SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_HIDDEN_VIS;
+
if (!DECL_EXTERNAL (decl)
&& (!TREE_PUBLIC (decl) || !DECL_WEAK (decl))
&& ! lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))
#define MACHO_SYMBOL_DEFINED_P(RTX) \
((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_DEFINED) != 0)
+/* Set on a symbol that has specified non-default visibility. */
+
+#define MACHO_SYMBOL_FLAG_HIDDEN_VIS ((SYMBOL_FLAG_SUBT_DEP) << 3)
+#define MACHO_SYMBOL_HIDDEN_VIS_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_HIDDEN_VIS) != 0)
+
/* Set on a symbol to indicate when fix-and-continue style code
generation is being used and the symbol refers to a static symbol
that should be rebound from new instances of a translation unit to