From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: Forwording symbols Date: Mon, 17 Jun 2024 14:58:21 +0200 Message-ID: References: <87jziod6yc.fsf@gmail.com> <86bk3zsup7.fsf@gnu.org> <86v827rc2x.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27363"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: eller.helmut@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 17 14:59:17 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 1sJBx7-0006t1-MI for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Jun 2024 14:59:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJBwL-0006xe-5t; Mon, 17 Jun 2024 08:58:29 -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 1sJBwJ-0006wp-9b for emacs-devel@gnu.org; Mon, 17 Jun 2024 08:58:27 -0400 Original-Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJBwH-0003KF-MR; Mon, 17 Jun 2024 08:58:27 -0400 Original-Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-57c83100c5fso4737767a12.3; Mon, 17 Jun 2024 05:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718629103; x=1719233903; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kkCclLV/yFPNKZmCjZYCu85dpblJGVZ4xx9dJ3NbMqw=; b=Xhxlp71DcJHFEV3pvxJVKlkKaxC/MsWB+hq9vQrjtYGnixZQSkjYiOwnuE6zd+jH6L CRXCVA9nEthcGGwaA5bXJe/uZpcC/wLLwcrynhKGufOncrygB+l4WJs1KJgVFiI+TVST lE7nOihX2Doew9jZtzLA0DSnP0RydNFpz9WBLPf+vTvXLOQJpVUvo1fog2IvpvEeU4mF ITaTj3+Vm3nGZvntBjBVowcLaTqy7Vcm4stNW0//wDFW7IEBhX3UszjEOM6rmCQOwggo RCL5o/cEZnulR0bfvhCdQXziifBOew9Hs4a127pSdoALQCyx8V4c71cKta19ilVRDMUO YEgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718629103; x=1719233903; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kkCclLV/yFPNKZmCjZYCu85dpblJGVZ4xx9dJ3NbMqw=; b=CgKaOu1xQtZqckuzA2Tn3vaRwXmOWyN4LvTEpnZjLLIrotwrCBIMVyW051ctK4XeHG fBJlaKBeznLzoUX8OnptVaUZ56a05nq0tUczgIvdbWk29DAtJtOBc6NHf4+fRUwCct9E KBKbx/VB1G51EKYBpDypuz81GVhFwWxPS+L57NyKeF8EHM1AAXS68GyC++4/NdKbgR/e y4IkJ/yw/M+D81EXvJvg6+WkxVK6rcm6URIFC65kVLrH+4JKynGhGWNh84T8OoX2+L7P IYvtKol0Pc7YgO6QvsNc3E+skZte03n7v8Pz20XqDYIMlESRSX5zJYNYeQSdkLAU5l9N ia3Q== X-Forwarded-Encrypted: i=1; AJvYcCUPUqTgIzf4+ZBy4ZeW1tWYA5DVZ8kezGlor4mYAS0yQ5KAXoBLhzP2EW2wwDtAhUrnCfJGGWwWqrsxplsmXdAPdeQn X-Gm-Message-State: AOJu0YzAkDCn0WwfS9xdAZbbBzwBa2NOLxxV0Fv01S219yk/SDCVMt65 gq1RlmnU5pWSJk9dNumGj8Xu1iTtZ+9TuQsV8RTEomv2Q6vGtNVVHKCR9Q== X-Google-Smtp-Source: AGHT+IE9xFu4yozMMNEUJO06mpBcdrnwc/UZRecd2vyPbXicwRKoWlhBwgidIie8/zFyLQeiU2KSZQ== X-Received: by 2002:a50:c309:0:b0:57c:8339:6dcc with SMTP id 4fb4d7f45d1cf-57cbd8b9c55mr6915373a12.33.1718629103145; Mon, 17 Jun 2024 05:58:23 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e36d9b.dip0.t-ipconnect.de. [217.227.109.155]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb72cdff1sm6441359a12.3.2024.06.17.05.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 05:58:22 -0700 (PDT) In-Reply-To: <86v827rc2x.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 17 Jun 2024 15:24:54 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x52b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:320212 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: eller.helmut@gmail.com, emacs-devel@gnu.org >> Date: Mon, 17 Jun 2024 14:15:25 +0200 >>=20 >> Eli Zaretskii writes: >>=20 >> >> > 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, adj= usts >> >> > it to the new basis and then writes it back. >> >>=20 >> >> Becasue of this >> >>=20 >> >> value +=3D emacs_basis (); >> >>=20 >> >> 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? >>=20 >> 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. Oh, I think you're right, I landed in the wrong place. It seems to be this one: static void dump_do_emacs_relocation (const uintptr_t dump_base, const struct emacs_reloc reloc) { ptrdiff_t pval; Lisp_Object lv; switch (reloc.type) { case RELOC_EMACS_COPY_FROM_DUMP: eassume (reloc.length > 0); memcpy (emacs_ptr_at (reloc.emacs_offset), dump_ptr (dump_base, reloc.u.dump_offset), reloc.length); break;