Linker : Make a map of typeinfo to vtable

Frederick Virchanza Gotham cauldwell.thomas@gmail.com
Fri Jan 19 22:52:52 GMT 2024


On Friday, January 19, 2024, Frederick Virchanza Gotham wrote:

>
> Or, instead of waiting until after all the vtables and typeinfo's have
> been generated, I can populate my array as and when these things are
> generated (I imagine this might be easier than waiting until they're all
> generated, but whatever works).
>


Having thought about this a little more, I realise that it's the C++
compiler that generates the vtables and typeinfo's, and so, inside the
source code for the linker, what I'll need to do is:

(1) After all the object files have been loaded in, make a finite list of
all typeinfo's and vtables
(2) Generate my array that maps typeinfo's to vtable pointers
(3) Place my array somewhere inside a section inside the ELF binary
(4) Provide the two linker symbols __map_typeinfohash_vtable and
__map_typeinfohash_vtable_size
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20240119/434ee93a/attachment.htm>


More information about the Binutils mailing list