From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44714 invoked by alias); 24 Jan 2018 12:23:23 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 44702 invoked by uid 89); 24 Jan 2018 12:23:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:gdb@sou, H*r:sk:static. X-HELO: mail-wr0-f174.google.com Received: from mail-wr0-f174.google.com (HELO mail-wr0-f174.google.com) (209.85.128.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 Jan 2018 12:23:21 +0000 Received: by mail-wr0-f174.google.com with SMTP id 16so3801253wry.12 for ; Wed, 24 Jan 2018 04:23:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=lgQTH5ccvKEvKeVCVTZwfU8LzQ4keMzf5v6AEC/Hv7A=; b=evLa/6zg+bVu74nIrnLD0pjQUGFnAsMVp6ZrQ+BhMslEnUzOIInr67k8wnDNb1Ro6+ dU/WtzK6wSz3ZL8CT/NIwYSK9xL+id0KHNnF5IbMTEHbQ80kTvVxkIxsgMnXaDBD9Mcw nbv6umsM4UqYQlvkPYw+0wy/TFTWMynwTIBx4qu2wCRH3umu6nagwHRw4wvcWLcEZMbJ 0zeA2okjiH19H2KkBvsI2wlqKLC4hWc7/uqOb7NyzonjesmaHX/fU+LuRWBYBNeEVSb2 atKTPr6i5X1gtAxSTFAs5suHJB2sbifnZ/hcfZzZvOcZbqG7/veq9tDr4Z7AFjXQT5Y2 wltg== X-Gm-Message-State: AKwxyte1om+EshyQVcTp8Drxe4n6vvPMDbsKwlWZvW8rZfYTFSyVz0Mr +zJXtTdVT/8eSk0Dwpn1bYpVmg== X-Google-Smtp-Source: AH8x224CB7PXxbtqOtOKNER4z/dzaDv5I0wn7+ycaXr72E77WrKSTn3IETFmheNYqHMSBoWonSy4Bg== X-Received: by 10.223.158.195 with SMTP id b3mr5203357wrf.236.1516796598599; Wed, 24 Jan 2018 04:23:18 -0800 (PST) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id v80sm50967wmv.17.2018.01.24.04.23.17 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 24 Jan 2018 04:23:18 -0800 (PST) From: Yao Qi To: gdb@sourceware.org Subject: [compile] Relocate memcpy Date: Wed, 24 Jan 2018 12:23:00 -0000 Message-ID: <868tcne98t.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00017.txt.bz2 I triage the fails in gdb.compile on arm-linux, (gdb) compile code -- ; (gdb) compile print vararray Program received signal SIGILL, Illegal instruction. 0xf77eb01c in _gdb_expr (__regs=3D0xf77ea000, __gdb_out_param=3D0xf77e9000)= at gdb command line:3 3 gdb command line: No such file or directory. The program being debugged was signaled while in a function called from GDB. GDB remains in the frame where the signal was received. To change this behavior use "set unwindonsignal on". Evaluation of the expression containing the function (_gdb_expr) will be abandoned. the code in the inferior is, 0xf77eb016 <+22>: f9 68 ldr r1, [r7, #12] 0xf77eb018 <+24>: 38 68 ldr r0, [r7, #0] 0xf77eb01a <+26>: 52 dd ble.n 0xf77eb0c2 =3D> 0xf77eb01c <+28>: f4 ff 00 bf ; instruction: 0xfff4bf00 0xf77eb020 <+32>: 10 37 adds r7, #16 0xf77eb022 <+34>: bd 46 mov sp, r7 0xf77eb024 <+36>: 80 bd pop {r7, pc} and the code in object file is (output from objdump) 16: 68f9 ldr r1, [r7, #12] 18: 6838 ldr r0, [r7, #0] 1a: f7ff fffe bl 0 1e: bf00 nop 20: 3710 adds r7, #16 22: 46bd mov sp, r7 24: bd80 pop {r7, pc} Looks the instruction "bl memcpy" is patched incorrectly. Can anyone help me to find which part I should dig it deeper? I do "set debug compile 1", and see the log, allocated 0x26 bytes at 0xf77eb000 prot 5 ELF mst_text symbol "memcpy" relocated to 0xf76b7ac0 allocated 0x1 bytes at 0xf77ea000 for registers allocated 0x14 bytes at 0xf77e9000 for printed value (gdb) p memcpy $1 =3D {} 0xf76b7ac0 My understanding is some thing patches "bl memcpy" with the address told by gdb. I don't know the patching is done by libcc1 or something else. Note that I post my question here instead of gcc@gcc.gnu.org because libcc1 is used by gdb, and was done by gdb people. --=20 Yao (=E9=BD=90=E5=B0=A7)