From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 8921B3858403 for ; Sun, 21 Jan 2024 22:35:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8921B3858403 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8921B3858403 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::52d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705876532; cv=none; b=A/k+0oj9ihwpw/otg0KpknkQkrSSj49el/FTmErgVOoalYH3wqXdZJylLu2DdhBwUQDWwiUsgDdZx7L2BILg93wJ66r0T0xhls1fLbtVD6nZBNgK1QNmP91oXhsZp1Qfwc+lgG5vQF4KZxIm/FHeR07XdFnhmHN1yrunKv91jUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705876532; c=relaxed/simple; bh=GK9rs4GEp2SwdmiE9k1cZ+b8g8qOdQlKGc1pP2dJJME=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=boJcqx9YEPAR+lqyGhjADT9ATk7/ogB9bfR2bIBUq8jihv/AXVZZFhB5c8XLenA+HrAlLnGINJ+r5kj42F5aioQQgQQSLHysTzi/wazHaJdPPxjNGI2e4LH0LJqwibRaXdh1mRX3l0EBGM0zdj8wN6yO/ELrzrS9U6NhfSfnYwg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-559f92bf7b6so4486140a12.0 for ; Sun, 21 Jan 2024 14:35:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705876521; x=1706481321; darn=sourceware.org; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GK9rs4GEp2SwdmiE9k1cZ+b8g8qOdQlKGc1pP2dJJME=; b=dO+9RTc+A25nsKhD08GnYOVs2K23Cwfygww8nnApYW6ROTazPZ+y7FZlTw4cI/KQOu ODai2lzPkeSW1nF1WLBqWXCzm2J1bH9ryLqEfb84++d5wZOcrxG+k7hLX7UchfJD07rF zY3jVHvlfM2rYH8sF7h4YDDbppd/+MXIu9FxN4KnpYYsWMG2YprVdu4DW/Xdsk7udqPk P0sxftBNsyrOBU2SJwxlqSXpjnVsNFleT62eYcrp5+0Kf5ni1eTKazO+m5ao2mH/u3qn 3Gf4pAi1RV9IazpHGtUuA14Zm7xJJAQyNPKcUO2RKjmTIupy8nl+q1ziywe1r0TZ3WP+ sh9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705876521; x=1706481321; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GK9rs4GEp2SwdmiE9k1cZ+b8g8qOdQlKGc1pP2dJJME=; b=F9EMJHbQf5ur/SRnM9mj5AGB4Muf2rRpmiy+4Xw95cBq+QgL3Wz0GfvS4NSmZ5epi7 kDXvTrTn3ucT78wWWRzhxRlEo8bEKFo9WrlaiUUnohvm99qROoHrD5YRXkDfa6FPO2Fb 5XEsCDxO/uuQQaJyBMvyBHHHxkQwAg/1ob4u0tw5FxS+DsACTG7PHCe3F6J+mBNhwgMr Ir3LVnSaiPYdS9wb3OKFlra0U9VqeJEhOQ5uViO385pe2uJ2mHxH0hg7xwgCdj0Wg4a2 vXOlwfLoMYEKzjSFqU8YWDRctkmL148nIjEdEy4oODkAN3iaL3BqoDgy8I2QrkSFv6FX IvTw== X-Gm-Message-State: AOJu0YysAiMiViWQ1UP0IyA6ZJwymHa8p7jDtVbwGjNOTidKZi9Y0a/V wePdr8sUajAAo6hTDl76080P7dIA389IaxvDQJmHGRpTIKAUfpYQ9w/Xt7nWfxFlXWaPXSJhODq sQFLu5mnG8w5s9aJSNM3lfBjKXtTbRF7lOz8= X-Google-Smtp-Source: AGHT+IFLsCXgByCnLJZNW0uxzykoa+MZNIRmB+x9QrOvgqmlBVzShWUaeTrSF3v9o3I3IL4935WEd4CvHoxqrFH829c= X-Received: by 2002:a50:fa85:0:b0:559:6ddc:50a9 with SMTP id w5-20020a50fa85000000b005596ddc50a9mr3497130edr.15.1705876521038; Sun, 21 Jan 2024 14:35:21 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: cauldwell.thomas@gmail.com From: Frederick Virchanza Gotham Date: Sun, 21 Jan 2024 22:35:11 +0000 Message-ID: Subject: Re: Linker : Make a map of typeinfo to vtable To: "binutils@sourceware.org" Content-Type: multipart/alternative; boundary="0000000000001138c0060f7c5480" X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --0000000000001138c0060f7c5480 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jan 21, 2024 at 3:27=E2=80=AFAM 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/5a75433a122ea1037ccb4e9483= 32f4886e242911...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? --0000000000001138c0060f7c5480--