public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>
To: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: Linker : Make a map of typeinfo to vtable
Date: Sat, 20 Jan 2024 19:44:50 +0000	[thread overview]
Message-ID: <CALtZhhOu+7i2HmC3+mBQUzKXV01Z2Ds+Q0Qbq5Y7+nSBWKpFeA@mail.gmail.com> (raw)
In-Reply-To: <CALtZhhP80W+LV3RjfB6UzKQjNwKAdrjKGg7EyAkn2w7W=kTShw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]

On Fri, Jan 19, 2024 at 10:52 PM 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).


Am I right in thinking that I should be looking in the file "bfd/linker.c",
Line 1382, at the function "_bfd_generic_link_add_one_symbol", which you
can see here:

    https://github.com/bminor/binutils-gdb/blob/
4a2318c9858fdb1899157339f526df3d20e43cfe/bfd/linker.c#L1382

So if the linker is looking through a load of object files (.o), static
archives (.a), and shared libraries (.so), every symbol encountered will be
processed by the "add_one_symbol" function.

And so if I add a few lines to that function to detect symbols beginning
with "_ZTI", I can add these symbols to a global container for all the
vtables. Also I can detect all the type_info's too.

Am I barking up the right tree?

  reply	other threads:[~2024-01-20 19:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19 22:29 Frederick Virchanza Gotham
2024-01-19 22:52 ` Frederick Virchanza Gotham
2024-01-20 19:44   ` Frederick Virchanza Gotham [this message]
2024-01-21  3:27     ` Frederick Virchanza Gotham
2024-01-21 22:35       ` Frederick Virchanza Gotham
2024-01-22 16:50 ` Michael Matz
2024-01-25 10:17   ` Frederick Virchanza Gotham
2024-01-25 23:02     ` Frederick Virchanza Gotham
2024-01-27 10:56       ` Frederick Virchanza Gotham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALtZhhOu+7i2HmC3+mBQUzKXV01Z2Ds+Q0Qbq5Y7+nSBWKpFeA@mail.gmail.com \
    --to=cauldwell.thomas@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).