This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

loading object files


Greetings,

I may as well make my experimental object classloader available to
anyone interested in it:

http://ops2.one-point.com/~jsturm/elfutils-0.1.tar.gz

(This has nothing to do with Red Hat's package of the same name.  I began
by writing utilities in Java to read and interpret the ELF object file
format as I was learning how linkers and loaders work.)

The package includes a classloader that is sort of midway between libgcj's
bytecode interpreter and SharedLibLoader; it can directly load and
execute gcj-compiled .o files on GNU/Linux (x86).

$ gcj -c Hello.java
$ elfloader Hello
Hello World

No link step required; elfloader links all needed objects at runtime.  In
theory it can do lazy loading as effectively as the bytecode interpreter.

The advantages are simplified build machinery and fast execution.  The
main disadvantage I find is that the result is almost undebuggable in gdb
(it can unwind stack frames but that's about it; no symbolic information
is available).  Also it's not quite portable, but porting to other ELF
targets shouldn't be too burdensome.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]