This is the mail archive of the gcc@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]

Re: Bug report: objc classes linked in wrong order


Hi,

if I got this discussion right the whole point is to replace
NXConstantString with NSConstantString ?

What is wrong with patching NXConstantString at runtime (rebasing it's
superclass to NSString and adding NSString functionality using
categories) ?
All that linking stuff looks far to complicated to me and probably isn't
really worth the effort.

I also do prefer having a separate libobjc for GNUstep environments
anyway (for various reasons). What's missing here is a reliable way to
get compiler-specific information (basically the config.h for libobjc).

Helge

nicola@brainstorm.co.uk wrote:
> On Tue, 30 May 2000 law@cygnus.com wrote:
> >   > I can't see any function or symbol we could make weak.
> >   > Making __objc_exec_class weak is not what we want - that function is
> >   > global.  The classes to load are got accessing directly the pointer passed
> >   > as argument of __objc_exec_class - don't see what we can make weak here.
> 
> > Start by ignoring all the Objective-C stuff.  Ultimately you have a hunk of
> > code.  That code is contained within a function, which in turn is contained
> > within a .o file, which is contained within a .a file.
> 
> Uhm.
> 
> Let's see if I can get it then.
> 
> In gcc/objc/objc-act.c I have:
> 
> static const char *
> build_module_descriptor ()
> {
>  // ...
> 
>  /* void _GLOBAL_$I$<gnyf> () {objc_execClass (&L_OBJC_MODULES);} */
> 
>  // ...
> }
> 
> [It outputs the code inside comment]
> 
> I could try making weak the module constructor
> 
>   _GLOBAL_.I..._.._.._egcs_20000501_libobjc_NXConstStr.mV7ccEc
> 
> in some way (is that what you are suggesting ?).  Don't know how useful
> could that be, since I need to override it in the GNUstep library (or in
> any other lib defining its own version of NXConstantString) with a
> constructor with exactly the same name - am I correct ?
> If that can be reasonably done, then I think it could be a nice solution.
> 
> Otherwise, the module constructor basically contains a call to the
> function objc_execClass, passing a fixed pointer, which then reads in what
> the pointer points to, information on selectors and classes to load, and
> loads them.  I don't think we can do anything here, because GNUstep needs
> to have NXConstantString in a different place in the class inheritance
> tree, so as soon as the class is put by the run-time in the class
> inheritance tree, that's the end of it.

-- 
SKYRIX-OS  Web Operating System       - http://www.skyrix.com
SKYRIX-IAS IntraNet Application Suite - http://www.skyrix.com

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