gcc: Constant string objects

1 
1 8.5 Constant String Objects
1 ===========================
1 
1 GNU Objective-C provides constant string objects that are generated
1 directly by the compiler.  You declare a constant string object by
1 prefixing a C constant string with the character '@':
1 
1        id myString = @"this is a constant string object";
1 
1  The constant string objects are by default instances of the
1 'NXConstantString' class which is provided by the GNU Objective-C
1 runtime.  To get the definition of this class you must include the
1 'objc/NXConstStr.h' header file.
1 
1  User defined libraries may want to implement their own constant string
1 class.  To be able to support them, the GNU Objective-C compiler
1 provides a new command line options
1 '-fconstant-string-class=CLASS-NAME'.  The provided class should adhere
1 to a strict structure, the same as 'NXConstantString''s structure:
1 
1 
1      @interface MyConstantStringClass
1      {
1        Class isa;
1        char *c_string;
1        unsigned int len;
1      }
1      @end
1 
1 
1  'NXConstantString' inherits from 'Object'; user class libraries may
1 choose to inherit the customized constant string class from a different
1 class than 'Object'.  There is no requirement in the methods the
1 constant string class has to implement, but the final ivar layout of the
1 class must be the compatible with the given structure.
1 
1  When the compiler creates the statically allocated constant string
1 object, the 'c_string' field will be filled by the compiler with the
1 string; the 'length' field will be filled by the compiler with the
1 string length; the 'isa' pointer will be filled with 'NULL' by the
1 compiler, and it will later be fixed up automatically at runtime by the
1 GNU Objective-C runtime library to point to the class which was set by
1 the '-fconstant-string-class' option when the object file is loaded (if
1 you wonder how it works behind the scenes, the name of the class to use,
1 and the list of static objects to fixup, are stored by the compiler in
1 the object file in a place where the GNU runtime library will find them
1 at runtime).
1 
1  As a result, when a file is compiled with the '-fconstant-string-class'
1 option, all the constant string objects will be instances of the class
1 specified as argument to this option.  It is possible to have multiple
1 compilation units referring to different constant string classes,
1 neither the compiler nor the linker impose any restrictions in doing
1 this.
1