PATCH: Fix invalid loader fixups from shared libobjc with

John David Anglin dave@hiauly1.hia.nrc.ca
Thu Jun 14 17:55:00 GMT 2001


> something else, right?  In that case, the patch is approved -- with
> the `#ifdef __hpux__' markers, for the branch.  Stan can do as he
> pleases on the mainline -- but the `#ifdef __hpux__' bit is definitely
> wrong in the general case.

Just to certain, this is what I propose to install.

OK?

-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2001-06-14  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* objc-act.c (handle_class_ref): Put the class reference in the
	variable section for hpux only.
	(handle_impent): Put the objc class and category name labels in
	the readonly data section for hpux only.

--- objc-act.c	Thu Jun 14 20:46:44 2001
+++ objc-act.c.new	Thu Jun 14 20:44:41 2001
@@ -8362,8 +8362,13 @@
       pushdecl (decl);
       rest_of_decl_compilation (decl, 0, 0, 0);
 
+#ifdef __hpux__
+      /* Put the decl in the variable section.  It may need relocation.  */
+      variable_section (decl, 1);
+#else
       /* Make following constant read-only (why not)?  */
       readonly_data_section ();
+#endif
 
       exp = build1 (ADDR_EXPR, string_type_node, decl);
 
@@ -8416,6 +8421,9 @@
 	{
 	  sprintf (string, "%sobjc_class_name_%s",
 		   (flag_next_runtime ? "." : "__"), class_name);
+#ifdef __hpux__
+	  readonly_data_section ();
+#endif
 	  assemble_global (string);
 	  assemble_label (string);
 	}
@@ -8450,6 +8458,9 @@
 	  sprintf (string, "%sobjc_category_name_%s_%s",
 		   (flag_next_runtime ? "." : "__"),
 		   class_name, class_super_name);
+#ifdef __hpux__
+	  readonly_data_section ();
+#endif
 	  assemble_global (string);
 	  assemble_label (string);
 	}



More information about the Gcc-patches mailing list