More questions about _GLOBAL

Adam Megacz gcj@lists.megacz.com
Tue Jan 29 14:28:00 GMT 2002


Anthony Green <green@redhat.com> writes:
> On Tue, 2002-01-29 at 13:55, Bryce McKinlay wrote:
> > In that case it should be fine to remove the __GLOBAL_foo.bar.baz. There
> > is no point registering a class which does not exist, after all.

> Except that I'm pretty sure we create one of these per .o, so the
> function may register multiple classes.

Yes, that is correct (I figured this out the hard way).

What would really help me, and wouldn't have much design impact on
gcj, is if there were a switch to create one __GLOBAL_foo per class,
not one per compilation unit. It would be even cooler if this
__GLOBAL_foo was named deterministically (right now the name seems to
be the mangling of a randomly chosen method). Since there would be a
1:1 mapping from classes to GLOBALs, the name could just be
__GLOBAL_<mangled-class-name>.

Is this an easy change or a hard one?  Would anybody be kind enough to
point me at the right part of gcc and give me a few hints? I feel
pretty comfortable screwing with libgcj, but I've never tried to
modify gcc before.

  - a



More information about the Java mailing list