diff options
Diffstat (limited to 'gcc/config/darwin.c')
-rw-r--r-- | gcc/config/darwin.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index dcb42d5199a..1ac122376de 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */ #include "ggc.h" #include "langhooks.h" #include "tm_p.h" +#include "errors.h" static int machopic_data_defined_p (const char *); static void update_non_lazy_ptrs (const char *); @@ -1115,7 +1116,7 @@ machopic_output_possible_stub_label (FILE *file, const char *name) const char *sym_name; sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); - if (sym_name[0] == '!' && sym_name[1] == 'T' + if (sym_name[0] == '!' && (sym_name[1] == 'T' || sym_name[1] == 't') && ! strcmp (name+2, sym_name+2)) { ASM_OUTPUT_LABEL (file, IDENTIFIER_POINTER (TREE_PURPOSE (temp))); @@ -1324,6 +1325,29 @@ darwin_globalize_label (FILE *stream, const char *name) default_globalize_label (stream, name); } +/* Emit an assembler directive to set visibility for a symbol. The + only supported visibilities are VISIBILITY_DEFAULT and + VISIBILITY_HIDDEN; the latter corresponds to Darwin's "private + extern". There is no MACH-O equivalent of ELF's + VISIBILITY_INTERNAL or VISIBILITY_PROTECTED. */ + +void +darwin_assemble_visibility (tree decl, int vis) +{ + if (vis == VISIBILITY_DEFAULT) + ; + else if (vis == VISIBILITY_HIDDEN) + { + fputs ("\t.private_extern ", asm_out_file); + assemble_name (asm_out_file, + (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)))); + fputs ("\n", asm_out_file); + } + else + warning ("internal and protected visibility attributes not supported" + "in this configuration; ignored"); +} + /* Output a difference of two labels that will be an assembly time constant if the two labels are local. (.long lab1-lab2 will be very different if lab1 is at the boundary between two sections; it |