trimming libgcj symbol exports
Bryce McKinlay
mckinlay@redhat.com
Wed Aug 3 15:26:00 GMT 2005
Anthony Green wrote:
>Has anybody looked at using ld version scripts to trim down the number
>of symbols we export from libgcj.so?
>>I suspect the attached version script can trim on the order of 15,000
>symbols from the .so. Unfortunately it causes ld to segv on my FC4
>machine.
>>The idea here is to trim out symbols from boehm-gc, libffi, internal
>gnu.* packages, zlib, etc. There are a lot of them!
>>
I havn't tried ld scripts, but removing the public symbols should reduce
the (stripped) binary size considerably and would probably speed up
loading due to less time spent in the dynamic linker. I would suspect
that symbols exported by boehm-gc, libffi, etc would be pretty
insignificant compared to those generated by GCJ for compiled Java code,
however.
With the BC-ABI, we don't actually need the vast majority of the public
symbols that GCJ defines for Java code. But unfortunately, because g++
does not support BC-ABI calls from CNI (implementing this looks like
quite a bit of work), we have not been able to get rid of them yet.
However, it now occurs to me that we could switch off the public symbols
by default for -findirect-dispatch, and add an -fcni option that
attempts to retain public symbols/CNI compatibility. Then again, CNI is
somewhat broken against the BC-ABI anyway, so perhaps we shouldn't even
bother with the -fcni option.
Bryce
More information about the Java
mailing list