From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: bug#24703: Store references in 8-byte chunks in compiled code Date: Sun, 16 Oct 2016 05:25:10 -0400 Message-ID: <87d1j0sl1l.fsf@netris.org> References: <87mvi5lzqu.fsf@netris.org> <87inssncln.fsf@netris.org> <8737jwnb1c.fsf@netris.org> <87r37gstf6.fsf_-_@netris.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvhhl-0001rm-Ju for bug-guix@gnu.org; Sun, 16 Oct 2016 05:26:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvhhi-0003Nc-9E for bug-guix@gnu.org; Sun, 16 Oct 2016 05:26:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:55583) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvhhi-0003N1-5O for bug-guix@gnu.org; Sun, 16 Oct 2016 05:26:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87r37gstf6.fsf_-_@netris.org> (Mark H. Weaver's message of "Sun, 16 Oct 2016 02:24:13 -0400") 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: 24703@debbugs.gnu.org Here's a complex example of a reference to: /gnu/store/80m11l8km7bwi9iljfyr82hmscaq4xk2-unixodbc-2.3.4/etc This also illustrates what can happen near the end of a reference. In this case, the last two characters are found at the end, within a 'mov' instruction, and the previous 4 characters are found near the beginning, after the first 8-byte chunk. ======== /gnu/store/80m11l8km7bwi9iljfyr82hmscaq4xk2-unixodbc-2.3.4/lib/libodbcinst.so.2.0.0 8238: 48 b8 2f 67 6e 75 2f movabs $0x6f74732f756e672f,%rax ; "/gnu/sto" 823f: 73 74 6f 8242: c7 05 6c fa 20 00 2e movl $0x652f342e,0x20fa6c(%rip) ; ".4/e" 8249: 34 2f 65 824c: c6 05 6b fa 20 00 00 movb $0x0,0x20fa6b(%rip) 8253: 48 89 05 26 fa 20 00 mov %rax,0x20fa26(%rip) 825a: 48 b8 72 65 2f 38 30 movabs $0x31316d30382f6572,%rax ; "re/80m11" 8261: 6d 31 31 8264: c7 05 16 0a 21 00 01 movl $0x1,0x210a16(%rip) 826b: 00 00 00 826e: 48 89 05 13 fa 20 00 mov %rax,0x20fa13(%rip) 8275: 48 b8 6c 38 6b 6d 37 movabs $0x697762376d6b386c,%rax ; "l8km7bwi" 827c: 62 77 69 827f: 48 8d 1d 42 94 00 00 lea 0x9442(%rip),%rbx 8286: 48 89 05 03 fa 20 00 mov %rax,0x20fa03(%rip) 828d: 48 b8 39 69 6c 6a 66 movabs $0x387279666a6c6939,%rax ; "9iljfyr8" 8294: 79 72 38 8297: 48 89 05 fa f9 20 00 mov %rax,0x20f9fa(%rip) 829e: 48 b8 32 68 6d 73 63 movabs $0x34716163736d6832,%rax ; "2hmscaq4" 82a5: 61 71 34 82a8: 48 89 05 f1 f9 20 00 mov %rax,0x20f9f1(%rip) 82af: 48 b8 78 6b 32 2d 75 movabs $0x78696e752d326b78,%rax ; "xk2-unix" 82b6: 6e 69 78 82b9: 48 89 05 e8 f9 20 00 mov %rax,0x20f9e8(%rip) 82c0: 48 b8 6f 64 62 63 2d movabs $0x332e322d6362646f,%rax ; "odbc-2.3" 82c7: 32 2e 33 82ca: 48 89 05 df f9 20 00 mov %rax,0x20f9df(%rip) 82d1: b8 74 63 00 00 mov $0x6374,%eax ; "tc" 82d6: 66 89 05 df f9 20 00 mov %ax,0x20f9df(%rip) Now imagine what will be required to graft cases like this. Consider what will happen for strings with an odd number of characters. The last character might be all by itself. When grafting, how will we achieve confidence that we've found the correct occurrence of the last character? I think we will have to give up our recently added feature of being able to change the version number of grafts. Oh, one more thing: I forgot to mention in my previous email, where 'bash-static' refers to 'glibc-intermediate', that on my system the referenced 'glibc-intermediate' has been garbage-collected from my system, so that's a real-world example of a broken link, and it happened to be the first one I investigated :-( Mark