This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug report: objc classes linked in wrong order
- To: law at cygnus dot com
- Subject: Re: Bug report: objc classes linked in wrong order
- From: nicola at brainstorm dot co dot uk
- Date: Tue, 30 May 2000 19:47:02 +0100 (BST)
- cc: egcs at sourceware dot cygnus dot com, ovidiu at cup dot hp dot com, gcc at gcc dot gnu dot org
On Tue, 30 May 2000 law@cygnus.com wrote:
>
> In message <Pine.LNX.4.10.10005301151001.2211-100000@lin9.brainstorm.co.uk>yo
> u write:
> > 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.