On Mon, 20 Apr 2026 10:59:07 GMT, Quan Anh Mai <[email protected]> wrote:
> I don't understand this change. Could you explain why the vtable is removed, > and how this change helps retain it? Why it is removed - in standard compile+link mode it is not removed. But with more aggressive linking (lto/ltgc) the linker seems to notice the vtable of this class as 'not needed' and just kicks it out. This can be worked around with adding '-Wl,--undefined=_ZTV8Metadata' to the libjvm linking but the setting looks a bit like a hack so something different might be needed. Usual recommended adjustments I found (additionally to the one in this PR) and use typeid in the class to keep the vtable (but we cannot do it because we set -fno-rtti in the build) or modify the destructor or constructor. Making the destructor virtual fails in the build because it seems not to work with derived classes. The adjustment Julian pointed to might indeed be better, it looks more reliable (while the constructor adjustment worked for me, I am not 100% sure it will work with all compilers/compiler versions). ------------- PR Comment: https://git.openjdk.org/jdk/pull/30771#issuecomment-4280168536
