summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index c509219e3aa..9c2593f14c8 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -993,7 +993,8 @@ use_blocks_for_decl_p (tree decl)
if (DECL_INITIAL (decl) == decl)
return false;
- /* If this decl is an alias, then we don't want to emit a definition. */
+ /* If this decl is an alias, then we don't want to emit a
+ definition. */
if (lookup_attribute ("alias", DECL_ATTRIBUTES (decl)))
return false;
@@ -5354,6 +5355,17 @@ do_assemble_alias (tree decl, tree target)
globalize_decl (decl);
maybe_assemble_visibility (decl);
}
+ if (lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl)))
+ {
+#if defined (ASM_OUTPUT_TYPE_DIRECTIVE) && HAVE_GAS_INDIRECT_FUNCTION
+ ASM_OUTPUT_TYPE_DIRECTIVE
+ (asm_out_file, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)),
+ IFUNC_ASM_TYPE);
+#else
+ error_at (DECL_SOURCE_LOCATION (decl),
+ "ifunc is not supported in this configuration");
+#endif
+ }
# ifdef ASM_OUTPUT_DEF_FROM_DECLS
ASM_OUTPUT_DEF_FROM_DECLS (asm_out_file, decl, target);