objc-act.c (handle_class_ref): Use rest_of_decl_compilation so that CHOOSE_SECTION...
authorGeoffrey Keating <geoffk@redhat.com>
Tue, 15 May 2001 19:54:53 +0000 (19:54 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Tue, 15 May 2001 19:54:53 +0000 (19:54 +0000)
* objc/objc-act.c (handle_class_ref): Use rest_of_decl_compilation
so that CHOOSE_SECTION gets used.

From-SVN: r42114

gcc/ChangeLog
gcc/objc/objc-act.c

index 0189949e0fbbcb3d12d60c869425e5509a287f0c..0ac1f3d36ee04549f8e0410dc9c8bddf567b0598 100644 (file)
@@ -1,5 +1,8 @@
 2001-05-15  Geoffrey Keating  <geoffk@redhat.com>
 
+       * objc/objc-act.c (handle_class_ref): Use rest_of_decl_compilation
+       so that CHOOSE_SECTION gets used.
+
        * config/rs6000/sysv4.h (ASM_PREFERRED_EH_DATA_FORMAT): Treat
        TARGET_RELOCATABLE like flag_pic for now.
 
index 5936e2ea7f3d222f9151b7f5051648f0d35d68a3..b6ea82101cfd12c534f4bb2b253d72633a5ecd86 100644 (file)
@@ -8438,20 +8438,16 @@ handle_class_ref (chain)
   pushdecl (decl);
   rest_of_decl_compilation (decl, 0, 0, 0);
 
-  /* Make following constant read-only, but only for GNU runtime.  */
-  if (!flag_next_runtime)
-    readonly_data_section ();
-
+  /* Make a decl for the address.  */
+  sprintf (string, "%sobjc_class_ref_%s",
+          (flag_next_runtime ? "." : "__"), name);
   exp = build1 (ADDR_EXPR, string_type_node, decl);
+  decl = build_decl (VAR_DECL, get_identifier (string), string_type_node);
+  DECL_INITIAL (decl) = exp;
+  TREE_STATIC (decl) = 1;
 
-  /* Align the section properly.  */
-  assemble_constant_align (exp);
-
-  /* Inform the assembler about this new external thing.  */
-  assemble_external (decl);
-
-  /* Output a constant to reference this address.  */
-  output_constant (exp, int_size_in_bytes (string_type_node));
+  pushdecl (decl);
+  rest_of_decl_compilation (decl, 0, 0, 0);
 }
 
 static void