PATCH: Enable dead-code stripping for __OBJC sections on Darwin

Ziemowit Laski zlaski@apple.com
Fri Aug 13 19:58:00 GMT 2004


Now that the mainline compiler depends on a dead-code stripping aware 
Darwin assembler and linker,
I'll bring over the no-dead-code stripping markings for ObjC-related 
sections.

OK?

--Zem

[gcc/ChangeLog]
2004-08-13  Ziemowit Laski  <zlaski@apple.com>

         * config/darwin.h (EXTRA_SECTION_FUNCTIONS): Mark the 
__sel_fixup,
         __cstring_object and __image_info sections with the 
no_dead_strip
         attribute.

Index: gcc/config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.89
diff -u -3 -p -r1.89 darwin.h
--- gcc/config/darwin.h 12 Aug 2004 13:57:01 -0000      1.89
+++ gcc/config/darwin.h 13 Aug 2004 19:46:49 -0000
@@ -659,7 +659,7 @@ SECTION_FUNCTION (objc_selector_refs_sec
                   ".objc_message_refs", 1)      \
  SECTION_FUNCTION (objc_selector_fixup_section, \
                   in_objc_selector_fixup,       \
-                 ".section __OBJC, __sel_fixup", 1)    \
+                 ".section __OBJC, __sel_fixup, regular, 
no_dead_strip", 1)    \
  SECTION_FUNCTION (objc_symbols_section,                \
                   in_objc_symbols,              \
                   ".objc_symbols", 1)   \
@@ -674,11 +674,11 @@ SECTION_FUNCTION (objc_string_object_sec
                   ".objc_string_object", 1)     \
  SECTION_FUNCTION (objc_constant_string_object_section, \
                   in_objc_constant_string_object,       \
-                 ".section __OBJC, __cstring_object", 1)       \
+                 ".section __OBJC, __cstring_object, regular, 
no_dead_strip", 1)       \
  /* Fix-and-Continue image marker.  */          \
  SECTION_FUNCTION (objc_image_info_section,     \
                    in_objc_image_info,          \
-                  ".section __OBJC, __image_info", 1)  \
+                  ".section __OBJC, __image_info, regular, 
no_dead_strip", 1)  \
  SECTION_FUNCTION (objc_class_names_section,    \
                 in_objc_class_names,            \
                 ".objc_class_names", 1) \

--------------------------------------------------------------
Ziemowit Laski                 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group        Cupertino, CA USA  95014-2083
Apple Computer, Inc.           +1.408.974.6229  Fax .5477



More information about the Gcc-patches mailing list