aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2020-10-06 18:50:22 +0100
committerIain Sandoe <iain@sandoe.co.uk>2020-10-11 11:52:44 +0100
commit1cc7476610299eb1969f6a93ee21010ac30f5dd6 (patch)
tree27da12173903432abe8b1586a6e8f392d3b58fd0 /gcc/objc
parent1174b08b140d1fed6012d7dcf66165fabd49b7e5 (diff)
downloadgcc-1cc7476610299eb1969f6a93ee21010ac30f5dd6.zip
gcc-1cc7476610299eb1969f6a93ee21010ac30f5dd6.tar.gz
gcc-1cc7476610299eb1969f6a93ee21010ac30f5dd6.tar.bz2
Objective-C++, Darwin : Make metadata 'extern "C"'.
For current system toolchains NeXT runtime metadata symbols are not mangled for Objective-C++ (i.e. they are considered to be 'extern "C"'). This change becomes essential when we start to emit metadata refs as hidden and weak which is required by later editions of the runtime and linkers. gcc/objc/ChangeLog: * objc-runtime-shared-support.c (start_var_decl): Make the decl_assembler_name follow the metadata name for C++ on NeXT runtime platforms.
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/objc-runtime-shared-support.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/objc/objc-runtime-shared-support.c b/gcc/objc/objc-runtime-shared-support.c
index 4aecc7f..16d4d63 100644
--- a/gcc/objc/objc-runtime-shared-support.c
+++ b/gcc/objc/objc-runtime-shared-support.c
@@ -117,14 +117,17 @@ add_field_decl (tree type, const char *name, tree **chain)
tree
start_var_decl (tree type, const char *name)
{
- tree var = build_decl (input_location,
- VAR_DECL, get_identifier (name), type);
- TREE_STATIC (var) = 1;
+ tree name_id = get_identifier (name);
+ tree var = build_decl (input_location, VAR_DECL, name_id, type);
DECL_INITIAL (var) = error_mark_node; /* A real initializer is coming... */
+ TREE_STATIC (var) = 1;
DECL_IGNORED_P (var) = 1;
DECL_ARTIFICIAL (var) = 1;
DECL_CONTEXT (var) = NULL_TREE;
#ifdef OBJCPLUS
+ /* Meta-data for the NeXT runtime is expected to be 'extern "C"'. */
+ if (flag_next_runtime)
+ SET_DECL_ASSEMBLER_NAME (var, name_id);
DECL_THIS_STATIC (var) = 1; /* squash redeclaration errors */
#endif
return var;