This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix handle_impent


Hi!

Recent changes to objc testsuite make many objc tests fail for me:
/usr/bin/ld: warning: type and size of dynamic symbol `__objc_class_name_Object' are not defined
output is:
/usr/bin/ld: warning: type and size of dynamic symbol `__objc_class_name_Object' are not defined

FAIL: objc/execute/accessing_ivars.m compilation,  -O0
UNRESOLVED: objc/execute/accessing_ivars.m execution,  -O0
...

The following patch does the trick (uses assemble_variable instead of
emitting it by hand).
Ok to commit?

2001-12-31  Jakub Jelinek  <jakub@redhat.com>

	* objc/objc-act.c (handle_impent): Use assemble_variable to emit
	__objc_class_name_*.

--- gcc/objc/objc-act.c.jj	Sat Dec 29 22:11:58 2001
+++ gcc/objc/objc-act.c	Mon Dec 31 16:43:02 2001
@@ -8353,14 +8353,23 @@ handle_impent (impent)
       ASM_DECLARE_CLASS_REFERENCE (asm_out_file, string);
       return;
     }
+  else
 #endif
+    {
+      tree decl, init;
 
-  /* (Should this be a routine in varasm.c?) */
-  readonly_data_section ();
-  assemble_global (string);
-  assemble_align (UNITS_PER_WORD);
-  assemble_label (string);
-  assemble_zeros (UNITS_PER_WORD);
+      init = build_int_2 (0, 0);
+      TREE_TYPE (init) = type_for_size (BITS_PER_WORD, 1);
+      decl = build_decl (VAR_DECL, get_identifier (string), TREE_TYPE (init));
+      TREE_PUBLIC (decl) = 1;
+      TREE_READONLY (decl) = 1;
+      TREE_USED (decl) = 1;
+      TREE_CONSTANT (decl) = 1;
+      DECL_CONTEXT (decl) = 0;
+      DECL_ARTIFICIAL (decl) = 1;
+      DECL_INITIAL (decl) = init;
+      assemble_variable (decl, 1, 0, 0);
+    }
 }
 
 static void

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]