More questions about _GLOBAL

Adam Megacz
Wed Jan 30 16:04:00 GMT 2002

Adam wrote:
> > 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>.

Bryce McKinlay <> writes:
> It shouldn't be too hard to change. You want to look at 
> emit_register_classes() in gcc/java/class.c.

Rock on, I got it working. Oh, BTW, GCC trees are really, really

    megacz@curry$ cat
    package org.xwt.fasdff;

    class bar {

    public class foo {
        public static void main(String[] s) {

    megacz@curry$ /usr/local/gcc/bin/i686-pc-mingw32-gcj -c --CLASSPATH= && /usr/local/gcc/bin/i686-pc-mingw32-nm foo.o | grep GLOBAL__I_
    000000a6 t
    000000ba t

If I submit a patch, would you all be interested in using this new
deterministic naming scheme? It lets method-gc prune unreachable
class$ objects, which saves a lot of space.

  - a 

More information about the Java mailing list