coolness

Jeff Sturm jsturm@sigma6.com
Thu Mar 4 10:08:00 GMT 1999


Thomas Reilly wrote:
> I don't see how this could work.  If I have code that uses the class
> foo in my original program then there will be symbols generated in the
> application like foo::bar, but these won't be valid symbols.  Won't
> the compiler have to know which Java classes being used are going to
> be loaded dynamically and have the generated code use dlsym before
> trying to access the symbols from foo?

I would think an explicit call to foo::bar should be resolved at link
time, or fail with an unresolved symbol.

What needs to work in gcj is Class.forName("...") which is scattered all
over in most java code, including the Sun java.* classes, and most JDBC
programs (consider how JDBC drivers are loaded dynamically).  Servlets
are another good example... http servlet classes are mapped dynamically
from the URL.

So gcj either needs some way to statically link together all the classes
it will eventually need, whether or not they are initially referenced,
or dynamic loading via dlopen/dlsym/etc.  (Obviously dynamic loading is
preferred...)

-- 
Jeff Sturm
jsturm@sigma6.com


More information about the Java mailing list