compacting _Jv_Utf8Const
Tom Tromey
tromey@redhat.com
Thu May 6 02:22:00 GMT 2004
>> I thought we did duplicate removal in the linker.
Per> Perhaps - but it doesn't follow the symbols are eliminated.
Per> In fact if the local symbols are visible in the output, it would
Per> be *wrong* to remove duplicates, even if they resolve to the same
Per> location.
My understanding -- and Anthony did this so we'd have to ask him or
read the linker source to be sure -- is that the linker makes a pass
over all Utf8Const structures and unifies all those with identical
contents.
The _Utf symbols are all private, so this is an ok thing to do.
Per> $ nm libgcj.so|grep ' _Utf'|awk '{print 1ドル}'>/tmp/bar
Per> $ uniq </tmp/bar|wc
Per> 54395 54395 489555
This doesn't measure duplication of contents, only symbol names. But
these are usually the same, generated based on a per-compilation-unit
counter... you may be remembering when the _Utf symbol names were
based on the string contents, but we changed this a while back because
we kept finding demangler crashes with _Utf symbols.
BTW I looked at the `nm | grep' output a bit closer and there are a
few symbols with the string `_Utf' in their names that aren't
Utf8Consts, eg:
_Z13_Jv_FindClassP13_Jv_Utf8ConstPN4java4lang11ClassLoaderE
grepping for ` _Utf' may be more robust.
Tom
More information about the Java
mailing list