This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: RFC: Is it OK to disassemble instructions twice ?
- From: Tamar Christina <Tamar dot Christina at arm dot com>
- To: "nickc at redhat dot com" <nickc at redhat dot com>, Florian Weimer <fweimer at redhat dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, nd <nd at arm dot com>
- Date: Fri, 16 Aug 2019 13:59:46 +0000
- Subject: RE: RFC: Is it OK to disassemble instructions twice ?
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qn4ctSpBfU+DPw7b5tfeuPqTVmgHCK4IL8MlE2Qz+BE=; b=X+vadxfbxo2IrtafkBddqOfkIiuWkFETWHz0EId2ngppIj3n/2rNvYplr/oiUqWNL+DbAAxYu/xJuIH00GhNutvV6D1/JKQmla7XdxrVBz5pyuUlFPSfdmwWA3n0R9oebAMfuYNVpiOLyu3AwqOB0l7B8nuaD376M0MfEQ6tW3omuyjeEjy+2rmhZmxfjmxnl4s2vbLiZkBINEchTdTfakj4ZiFq/1yiCHmlXUjgxRQ3KbH5ncSz6fTjGNPKpfeJ7RennVPJss0UrB8uUm8fTORhj33Ru+IXU1Ezv2vhr/HR4z85ePUUMcEG9CeLnsoZmbio/X4kTTdFToQSckPphw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XMfjv1/N5AqSChkLAMb43GZRT9oxoED7gW7YwRCye4lko2Gh2zoir5UoAr46Iq2RHtn90U9cmpKPijlal8jPWAu0IGiNb9X77hyulbipvy6tDWljzkbc8XfpQUVXeQx304VM2lNV9O0qfMoiIKFZgNE5gTur3qsl6SNk02+fu9i6pTdehv+vx9bAkHvyBKckNLbCXqiV7ZCb4V0wP8yo7B78zlTCYPpXEZWnxfbfqVBOiM4AgFuPgHAjvrDicNpGS0brM2d15h7PyMxItfcLadSTTzHrdPU2X8KdJLlvvDdTROo+PjchFVmpmmSxIZHk1RRfRQTRPVP6T7FRmyX94A==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tamar dot Christina at arm dot com;
- References: <87k1bdmsiq.fsf@redhat.com> <DB6PR0802MB2309CB6ECB62E427D6343D4DFFAF0@DB6PR0802MB2309.eurprd08.prod.outlook.com> <87sgq11g3a.fsf@oldenburg2.str.redhat.com> <12d9e0a5-b292-db8d-728c-e600f46f7a16@redhat.com>
Hi Nick, Florian,
>
> > Or maybe you could add a per-target maximum instruction length and do
> > the double-disassembly only if there is a relocation within the
> > maximum instruction length window.
>
> That would work. The code at the moment does limit the double
> disassembly to only when relocs are associated with the section being
> disassembled, and then only if the next reloc is not targetting the start of the
> instruction that is about to be disassembled. It is a good suggestion though,
> so I will have a go at implementing it.
>
But this means that on Arm we'd still take the double hit for no reason. The maximum instruction length
will have to be 32 due to Arm mode, so when disassembling Thumb code you'll hit a relocation in the middle of
this maximum quite often. If the maximum is reconfigurable then you'd be back where you started anyway since
every insn could potentially be a different length than the next.
So I'd say giving the target an opt-out of this would also be desirable.
Cheers,
Tamar
> Cheers
> Nick
>