codecvt support was added to the internal copy of libio in GCC 3.0, but the C++ compiler in that GCC version uses a different ABI for placing vtable pointers, so libio in glibc is already ABI-incompatible with C++, and cannot be used with libstdc++.
I believe that we can remove the codecvt vtable without affecting old binaries (even though the struct definition was exposed in <libio.h>).
Also see <https://sourceware.org/glibc/wiki/LibioVtables>.
The master branch has been updated by Florian Weimer <email@example.com>:
Author: Florian Weimer <firstname.lastname@example.org>
Date: Mon May 20 21:54:57 2019 +0200
libio: Remove codecvt vtable [BZ #24588]
The codecvt vtable is not a real vtable because it also contains the
conversion state data. Furthermore, wide stream support was added to
GCC 3.0, after a C++ ABI bump, so there is no compatibility
requirement with libstdc++.
This change removes several unmangled function pointers which could
be used with a corrupted FILE object to redirect execution. (libio
vtable verification did not cover the codecvt vtable.)
Reviewed-by: Yann Droneaud <email@example.com>
Reviewed-by: Adhemerval Zanella <firstname.lastname@example.org>
Fixed for glibc 2.30.