Page faults and libgcj.so startup time
Jeff Sturm
jsturm@one-point.com
Tue Apr 3 16:55:00 GMT 2001
On 3 Apr 2001, Per Bothner wrote:
> But it would be nice to understand better what R_386_RELATIVE is
> used for, especially since they seem to be the biggest chunk.
It is used whenever data is initialized to a text symbol, e.g.:
static void f() {}
void (*fp)() = f;
This needs a fixup because the image start address cannot be known at link
time. The _Utf* symbols in libgcj link this way. I have a hunch the
relocs here could be eliminated by replacing the static initializers with
code.
> Would compiling an entire package with a single compilation help?
> I would think it would remove some relocations, since they are now
> to the same .o file, and so may not need relocation at all,
> especially if -Bsymbolic is used.
In theory it could help, since relative addressing can be used between
text symbols within one object. Also some redundant Utf* symbols could be
eliminated. I'm not sure GNU ld is as smart as it can be about -Bsymbolic
though.
There are other benefits to compiling whole packages as well. Has anybody
tried it with libgcj?
Jeff
More information about the Java
mailing list