aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc/objc-gnu-runtime-abi-01.c
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2011-02-19 00:12:45 +0000
committerNicola Pero <nicola@gcc.gnu.org>2011-02-19 00:12:45 +0000
commit475b5d2a3b7e68b4b46eb1a43aa21316b8675b60 (patch)
tree070fd0f998fe2d7dacc6fe264489f4acf1f11b82 /gcc/objc/objc-gnu-runtime-abi-01.c
parent34c10b3bbde4bb401d78c8230bfce893e08f6dce (diff)
downloadgcc-475b5d2a3b7e68b4b46eb1a43aa21316b8675b60.zip
gcc-475b5d2a3b7e68b4b46eb1a43aa21316b8675b60.tar.gz
gcc-475b5d2a3b7e68b4b46eb1a43aa21316b8675b60.tar.bz2
Do no emit GNU metadata if there is nothing to put into it
From-SVN: r170292
Diffstat (limited to 'gcc/objc/objc-gnu-runtime-abi-01.c')
-rw-r--r--gcc/objc/objc-gnu-runtime-abi-01.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/objc/objc-gnu-runtime-abi-01.c b/gcc/objc/objc-gnu-runtime-abi-01.c
index a13f015..fdf0480 100644
--- a/gcc/objc/objc-gnu-runtime-abi-01.c
+++ b/gcc/objc/objc-gnu-runtime-abi-01.c
@@ -2105,11 +2105,23 @@ objc_generate_v1_gnu_metadata (void)
generate_protocols ();
/* Arrange for ObjC data structures to be initialized at run time. */
- generate_objc_symtab_decl ();
- /* Make sure that the meta-data are identified as being GNU-runtime. */
- build_module_descriptor (OBJC_VERSION,
- build_tree_list (objc_meta, meta_base));
- build_module_initializer_routine ();
+ /* FIXME: Have some more elegant way to determine if we need to
+ generate objc_symtab_decl or not, instead of checking these
+ global symbols. */
+ if (imp_list || class_names_chain
+ || meth_var_names_chain || meth_var_types_chain || sel_ref_chain
+ || prop_names_attr_chain)
+ generate_objc_symtab_decl ();
+
+ if (imp_list || class_names_chain || objc_static_instances
+ || meth_var_names_chain || meth_var_types_chain || sel_ref_chain)
+ {
+ /* Make sure that the meta-data are identified as being
+ GNU-runtime. */
+ build_module_descriptor (OBJC_VERSION,
+ build_tree_list (objc_meta, meta_base));
+ build_module_initializer_routine ();
+ }
/* Dump the class references. This forces the appropriate classes
to be linked into the executable image, preserving unix archive