From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#30820: Chunked store references in compiled code break grafting (again) Date: Mon, 19 Mar 2018 23:29:10 +0100 Message-ID: <87d0zzg0nd.fsf@gnu.org> References: <87o9jq7j7r.fsf@gnu.org> <87efkm7eov.fsf@gnu.org> <20180319222205.2e35f26f@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey3I6-0005P6-QP for bug-guix@gnu.org; Mon, 19 Mar 2018 18:30:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey3I2-00055w-Ru for bug-guix@gnu.org; Mon, 19 Mar 2018 18:30:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:34422) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ey3I2-00055l-NK for bug-guix@gnu.org; Mon, 19 Mar 2018 18:30:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20180319222205.2e35f26f@scratchpost.org> (Danny Milosavljevic's message of "Mon, 19 Mar 2018 22:22:05 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Danny Milosavljevic Cc: 30820@debbugs.gnu.org Heya, Danny Milosavljevic skribis: >> The second issue is that the patch only ever worked with literal >> strings. It does not =E2=80=9Csee=E2=80=9D strings in constant arrays l= ike the =E2=80=98str=E2=80=99 >> array in the example above. >>=20 >> The gconv-module file name mentioned in the first message in this bug >> report is an example of a string assigned to a static array, in >> iconv/gconv_conf.c: >>=20 >> /* This is the default path where we look for module lists. */ >> static const char default_gconv_path[] =3D GCONV_PATH; > > I don't understand why this is a problem. Grafting would just > mutate default_gconv_path, right? Who cares how the runtime memcpy > works (if there's no literal as source)? At compile-time, GCC finds out that =E2=80=98default_gconv_path=E2=80=99 is= used only in one place, in an strcpy call. Thus, it chooses to use the movabs optimization, and as a consequence, to split =E2=80=98default_gconv_path=E2= =80=99 in 8-byte chunks. It can do so because it=E2=80=99s =E2=80=98static=E2=80=99. Ludo=E2=80=99.