summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-09 14:12:57 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-09 14:12:57 +0000
commit85c0a25cac9bede4664b0ddaa95df5d0142af79a (patch)
treeda6907a1c5c815841942c5773bfc6c02f7b889e8 /gcc/varasm.c
parenteb8ae8fc718711519de1ff9dcc4285d7742dd642 (diff)
downloadgcc-85c0a25cac9bede4664b0ddaa95df5d0142af79a.tar.gz
* configure.ac (gnu_indirect_function): New test.
* configure: Rebuilt. * config.in (HAVE_GAS_INDIRECT_FUNCTION): New. * defaults.h (IFUNC_ASM_TYPE): Provide default. * doc/extend.texi (Function Attributes): Document ifunc. * varasm.c (do_assemble_alias): Deal with ifuncs too. c-family/ * c-common.c (handle_alias_ifunc_attribute): New, broken out of ... (handle_alias_attribute): ... here. (handle_ifunc_attribute): New. testsuite/ * lib/target-supports-dg.exp (dg-require-ifunc): New. * lib/target-supports.exp (check_ifunc_available): New. * gcc.dg/attr-ifunc-1.c: New. * gcc.dg/attr-ifunc-2.c: New. * gcc.dg/attr-ifunc-3.c: New. * gcc.dg/attr-ifunc-4.c: New. * gcc.dg/attr-ifunc-5.c: New. * testsuite/g++.dg/ext/attr-ifunc-1.C * testsuite/g++.dg/ext/attr-ifunc-2.C * testsuite/g++.dg/ext/attr-ifunc-3.C * testsuite/g++.dg/ext/attr-ifunc-4.C git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164110 138bc75d-0d04-0410-961f-82ee72b054a4
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);