From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id C958D3858D37 for ; Thu, 25 Jan 2024 23:02:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C958D3858D37 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 C958D3858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::329 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706223767; cv=none; b=aM5D5nOZZPJjP4UXoXM2n4c3igDgsxSqAZSvLzJ8vnP1No6adeAqL1rkJ/ubBL73V/mW18BeDXWAgPW7hh5whhUhbHEumwQZKtySKu0Wr1MqPxKkQw9NEuYPhRCCxn7bq9cqqxBb7ROI6lU1QGX/iofSQhoZGSWRpzOJh483o+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706223767; c=relaxed/simple; bh=Nujvj+0bl16tuhcl0FGb1D4tURYUcPQnWGXAgrhmjx8=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=TMMlUqU9mjHs33yiBftHmcyUyiHfKu8Fao2qmfH5x3VD/PjZa6Vw316SbUktLOUtoWhICxojFoVkwQQEjy6zjGRQrNEx2GqyBE8D2diSzNuiBHzllpha58N/PU/Shn2gR09nJhoGfH/+oUvvOiHq7JitIeEgI2y0CLwe7iN42ik= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40e9101b5f9so80891685e9.3 for ; Thu, 25 Jan 2024 15:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706223763; x=1706828563; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Nujvj+0bl16tuhcl0FGb1D4tURYUcPQnWGXAgrhmjx8=; b=Km0NSFOk+lqF0Dblq8bl2YOlmZJ+kVxLWuONEE0tRjwD0Wf1UYj80c6wHEkXIENYcL BwZYryXTTLTAH1i7tInKfyY5yXfCewnYXRrZS6XQjf0FTUCmXOnSQNwSpQc7U179gaVO A4whs5cDVwkOonakkTbr81yFxx+vttuqSe1ViR/xbB+3X9zLUnyG2UUqX+roB8NlJWw4 X3h4vY9Ed8EfkURHDwTGSEYkvohYPyeKmfkKhYoetrPF2vlt51C49x/KDLML6jTb+S/S ATr3qrUPs8zbKCTK6MTEdo5Icsd45tYeLmUAi14GqwANutj+bhIVy0DGqgCGA3plL1NK 3jbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706223763; x=1706828563; h=content-transfer-encoding:cc: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=Nujvj+0bl16tuhcl0FGb1D4tURYUcPQnWGXAgrhmjx8=; b=r+Uc/N3H7Y2ezLwHNNU5S8F3kyPK7kFca6yWd1YlXgZntmA2nOKSgFi6aeE8NalMM5 y2c6dDaJlAxSUPFNlT1eXUuRgWH5kmARHRBA9en1Q6Qs+T8NlqXvpJq6b72BmKoMMX7k axBPwBcBdy7q+Q2oUA980cTQJtpSztU3bNhOIUnEz3tqMNgm8/MiysHw4UaVG6XPqNzA 0tHNNneId3UCnS9keBhe8mAKNMxpheMChr97ogKMAGFTygrj0JWYI1gqj84Yk6ErVbV9 6+xFBF6du2pPB3S3lHvXJPRVm0vwE9iF+Nzz/usS0zEmi0QSKmbu2DrJMaIxsYDoc8c+ i0Fg== X-Gm-Message-State: AOJu0YzmAImlXm3e6DUWYZfnolaPXUk6V4fSddVFNSuHo4v1nIEvDsfi mTH9UG+yI91TQIjc3UbcpTHjV4bMGcgthysPp03/jJtZxuicBbn9Ecj3M3ySLRM1Z/PHFtBBdkO WRj8hmCWeZYWnYOn/ZFAA9Sw0EDxomXlkfyM= X-Google-Smtp-Source: AGHT+IHeEpAl5uzT/tzOkgk7FRGEXX960hSQoo3jW/7MGhZAkur/8J01mUJoyLo/qawCUdaWnF+o40wV7tuM6WZ3r0M= X-Received: by 2002:a05:600c:6a09:b0:40e:7b8c:20d2 with SMTP id jj9-20020a05600c6a0900b0040e7b8c20d2mr267888wmb.188.1706223762592; Thu, 25 Jan 2024 15:02:42 -0800 (PST) MIME-Version: 1.0 References: <51e942dd-dbe0-f644-e9bb-0e12fc69f076@suse.de> In-Reply-To: Reply-To: cauldwell.thomas@gmail.com From: Frederick Virchanza Gotham Date: Thu, 25 Jan 2024 23:02:32 +0000 Message-ID: Subject: Re: Linker : Make a map of typeinfo to vtable To: binutils@sourceware.org Cc: Michael Matz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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: On Thu, Jan 25, 2024 at 10:17=E2=80=AFAM Frederick Virchanza Gotham wrote: > > So, somehow, I need to call 'bfd_final_link' in > order get the offsets for the vtables inside their section, but then I > need to append my own array onto the end of the section, and then > perform the final link. I've had another idea. Inside the function "bfd_generic_link_add_one_symbol", I can keep a record of all vtables and typeinfo's encountered. So before the call to 'ldwrite', I know how many entries there will be in my array. So before I call 'ldwrite', I add a new symbol to the readonly section for my array, calling it "__map_typeinfo_vtable", and I give it the correct size. I fill my array with all zeroes, except for a 128-Bit magic number at the beginning: 021fed6674b3ac813273c5909cb7d0ac. So then after I call 'ldwrite' and have produced the final binary file, I re-open the binary file and I scan through it until I find my magic number (i.e. 3c1fed6f74bb6c814173c5409cb7d0aa), and I replace it with the correct data. This will work I think. I'm gonna try code it now.