banging my head against the wall.... _GLOBAL__I__*?
Per Bothner
per@bothner.com
Mon Jan 28 10:45:00 GMT 2002
Adam Megacz wrote:
> and even lower if I can figure out a way to be more
> selective about what reflection data I retain.
I think there is a lot of room for a more compact encoding
of reflective data. You may have seen the relatively recent
discussion on this topic.
> Anyways, the last problem I'm struggling with is that my stripped
> binaries SEGV somewhere inside the symbol
> "_GLOBAL__I__ZN4java4util12AbstractList3addEiPNS_4lang6ObjectE". This
> function is called by __main(), and itself does little more than call
> _Jv_RegisterClass four times (SEGV is in the third call).
Symbols of the _GLOBAL__I__XXX are used for static initializers - i.e.
code that executed on startup, normally before main is called. Don't
get hung up on the actual XXX - it is just a magic mangling to create
a unique symbol. Gcj creates static initializer functions that call
_Jv_RegisterClass to register each class in a global table, so future
Class.forName can find them.
> The SEGV is clearly a result of me stripping something out of the
> binary that I shouldn't have... but I have no idea where to start
> looking since I'm not sure what this symbol does, or which classes it
> is trying to _Jv_Register (wild guess: superclasses/superinterfaces of
> AbstractList?).
Not necessarily. Why don't you look at the assembly code?
> What I really can't figure out is why any part of AbstractList.java
> needs to be invoked when the binary is loaded. What if you never
> instantiate an AbstractList or any of its subclasses?
You still need to register the class in case of a Class.forName.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/
More information about the Java
mailing list