From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id CAB543857C70 for ; Sat, 20 Jan 2024 19:44:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CAB543857C70 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 CAB543857C70 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::532 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705779894; cv=none; b=tQv25qyisRzu4ZjH5v32zgdpEJEUmVSAgvzOkYbfoE0GiXIm4Zo7RjQO3PLytEUkxoqhpdeV0kq0vYhRuFYV0+4Rw3t2uopVRdgMcWoI+ntmsubwfgwgJh4GckJRTSpmOkNXgF9bk8qsdWvo35yIdtnlIu35z+5RAidDM7bsu2Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705779894; c=relaxed/simple; bh=2eRnx9JpaP7vAyXCMlFPWxQ8xRmhh1+xp1k0n2wL9kE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=aqX8dDJjhQZeTxeUIy6v17vJVj4HZlX17YU8X9a+1+jsvz57mdWfyK5qIhYX8Al+NuJEOzcePEYfbo0L2vOCMviMf4S+SRUBvNsF4e1v+3Za5Z5JaeDxE+eOFLuF2evqyi/R6/ejF1W1YDneOs2Xa38+7yI0Pv6y5w1Rqt7xyQo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-55a90a0a1a1so736537a12.0 for ; Sat, 20 Jan 2024 11:44:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705779891; x=1706384691; darn=sourceware.org; h=to:subject:message-id:date:from:references:in-reply-to:reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LDgBai+6srgIJa5hZE9XnASuexSdlrtkoHH0I9s6YYo=; b=ZEWWJ/UUnSLkNaA1OMRiRgy8tJakMXyEw/CeKNkV2+K+2jQnEompYFBM1L/gWkitLm avAYOPfFiBiYy+iYrAE54poxw3UfP5LtMlqZApTEjLLIzm7Fq8mJ5Pijzhnj/NJVshHE l+CE1fINtTsTsnIq7q+4JapqGzTe40oec90lrUT7KnuVm43rFK8OXzcHwZc36iZFYjcN 6Zb2g5px9JTxBfAKZbmix3uARk5G7Za0cJCs2XcYmVfPnKVUbLmg/o3nJQ0aC6rLqS9+ r1JehUSFa9dvV7I+DcSrQ5KT2c/suflzgMzdh3vqJE/GFEmJCIpcLegtAju6/6tPjGCk bqSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705779891; x=1706384691; h=to:subject:message-id:date:from:references:in-reply-to:reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LDgBai+6srgIJa5hZE9XnASuexSdlrtkoHH0I9s6YYo=; b=fXZVaOddGsL2c+okDVBGfCwFz5vasDnmYnSvm9ZvGwikv2llLsROtEu+8WaZibuJfD stxH4U+eO80fvwrLI6zgg0DT2/BBubA18pumnWcP1y3YWNiLNHoFYmuhPhqyun8jKZDc VXvSzMvxxvoJIwKphYc/hnO3EIfMHQr3e5OrzC+5Qw0fGGPvfGU3rK/SQ0jeurFW2z14 1dhF/8FsAXCaQGF8cvUi9IpNgfOy/TmWkHN2sbxs0WhMSCnnqYjynf5OFjLzf8gwIV8c /FYe+fX+8LsLivBvdzw3vTofpj60XW4X/pjzK97f58ubWDaKK+2y6Lmi8pSBmiIn0CA6 fCJw== X-Gm-Message-State: AOJu0YxRvUa6N87u7V9A3/Nx+BrIiZKQA/AG+StukPQzshH9qaWtMREx OEl0WOq3bfhNUmqfwdC53ZFK1ZeiANT7LldQsKbTwSZAE9tTBDQAud+sofPsJtVTP5dxpUZl5Z7 H0IlVAy2zjuiLeIz9USBETn7PV84eYXcP X-Google-Smtp-Source: AGHT+IGksQNCUf9wH8B/IDGHuoYxUmuyoMNdZPT95NbGNYwwVSK/FB9euEjQYlyG55yafvTAithGGEgyUBMdajafysY= X-Received: by 2002:a05:6402:31b7:b0:557:86b:fc4c with SMTP id dj23-20020a05640231b700b00557086bfc4cmr409254edb.77.1705779891091; Sat, 20 Jan 2024 11:44:51 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a54:3345:0:b0:246:dedf:6cdc with HTTP; Sat, 20 Jan 2024 11:44:50 -0800 (PST) Reply-To: cauldwell.thomas@gmail.com In-Reply-To: References: From: Frederick Virchanza Gotham Date: Sat, 20 Jan 2024 19:44:50 +0000 Message-ID: Subject: Linker : Make a map of typeinfo to vtable To: "binutils@sourceware.org" Content-Type: multipart/alternative; boundary="000000000000793ce0060f65d442" X-Spam-Status: No, score=-0.7 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: --000000000000793ce0060f65d442 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 19, 2024 at 10:52=E2=80=AFPM 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? --000000000000793ce0060f65d442--