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: Re: Linker : Make a map of typeinfo to vtable
Date: Sun, 21 Jan 2024 22:35:11 +0000	[thread overview]
Message-ID: <CALtZhhPB2CabJr4pMLyyHu4cdar6S1U2JSVnALpCNHb0+NXnkg@mail.gmail.com> (raw)
In-Reply-To: <CALtZhhNy6puez4m63emWUbAh9kqHiz8DKwHd4AhkcC2rGgyaog@mail.gmail.com>

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

On Sun, Jan 21, 2024 at 3:27 AM Frederick Virchanza Gotham wrote:


> I'm still a bit clueless here, but here's what I've got so far, I'm able
> to print out a list of all the classes that have both a vtable and a
> typeinfo:
>
> Here's the link to Github showing the changes I've made so far, I've
> created two new files 'polymorphism.h' and 'polymorphism.c'.
>
>
> https://github.com/bminor/binutils-gdb/compare/5a75433a122ea1037ccb4e948332f4886e242911...healytpk:linker-vtable:master
>
>

I'm close to getting this working but I'm stuck on something. The function,
"_bfd_generic_link_add_one_symbol", is called to add each new symbol, and
I'm able to record the names of the vtables and typeinfo's that are
encountered. One of the arguments passed to that function is called
'value', and it is the symbol's byte offset within its section. The problem
however is that sometimes 'value' is set to 0. I can understand if just one
symbol has its offset set to 0 inside its section (i.e. if it's the first
thing in the section), but a typeinfo and a vtable for different types
can't both be located at the beginning of the same section.

Does anyone know why "_bfd_generic_link_add_one_symbol" would be called
with an argument of 0 for 'value' when it is defining a symbol?

  reply	other threads:[~2024-01-21 22:35 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
2024-01-21  3:27     ` Frederick Virchanza Gotham
2024-01-21 22:35       ` Frederick Virchanza Gotham [this message]
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=CALtZhhPB2CabJr4pMLyyHu4cdar6S1U2JSVnALpCNHb0+NXnkg@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).