From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MPS: Forwording symbols Date: Mon, 17 Jun 2024 15:24:54 +0300 Message-ID: <86v827rc2x.fsf@gnu.org> References: <87jziod6yc.fsf@gmail.com> <86bk3zsup7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8665"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eller.helmut@gmail.com, emacs-devel@gnu.org To: Gerd =?iso-8859-1?Q?M=F6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 17 14:25:37 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sJBQX-00022g-7K for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Jun 2024 14:25:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJBPv-0007Ik-2m; Mon, 17 Jun 2024 08:24:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJBPt-0007IU-In for emacs-devel@gnu.org; Mon, 17 Jun 2024 08:24:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJBPt-0005tQ-9S; Mon, 17 Jun 2024 08:24:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=gbHyE0PT+qcgEHWzh93CZ5oN0iGPCHiCzqb3UdRf8/w=; b=H1cLw3oK6PLF4l2Ot9QB dA+MI46FJcCLjuRx0p3oNqzroyd21Xao7SfNIy9XmAxLPDopKyMxLsr4GyhyFIxDLba4Y0WQLqYss o0NveFq+7ecSSaYdiWS+gtMJSER/ZmYeuRl/8UBabQLN7mgGTDKCLbjEL5m6m7tRbib+SEYGfYp2K oGpbhEaHn1m1zPsJv+pFiBXrY3vpKux6ZgAflrdCE5TUn3YlidWriGPYf9TwDkl2hCvpj0MaiNSmj Nic65EX0boVtvIxk7M0iv2Q9raJMiX3/vIbi9t3qAKWHy7kg8tRG+c3jSAZ4KCJNs7sKtw50VCaLQ X/BMM8Vz0SC75A==; In-Reply-To: (message from Gerd =?iso-8859-1?Q?M=F6llmann?= on Mon, 17 Jun 2024 14:15:25 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320211 Archived-At: > From: Gerd Möllmann > Cc: eller.helmut@gmail.com, emacs-devel@gnu.org > Date: Mon, 17 Jun 2024 14:15:25 +0200 > > Eli Zaretskii writes: > > >> > Hm, why do you think it writes to the data segment? Confusing names > >> > aside, it seems to read a value, which presumably is a pointer, adjusts > >> > it to the new basis and then writes it back. > >> > >> Becasue of this > >> > >> value += emacs_basis (); > >> > >> It has dumnped pointer - basis, and now uses that value to get the > >> pointer in the current process. > > > > Isn't this because the dumped data is loaded with a different base > > address than the one with which is was dumped? > > That'c correct. The same happens, with a different basis, for addresses > in the dump. Helmut asked how I know that it writes to Emacs' data > segment. That's from the use of emacs_basis. My reading of the code snippet you posted is that it writes to the same address as the one from which it read. IOW, the value is read, updated, and then written to the same address. Or what did I miss? Maybe I don't understand what you mean by "Emacs data segment" or what is the significance of that.