From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8600 Path: news.gmane.org!not-for-mail From: Alex Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 3/3] Add script to add CFI directives to asm files in debug builds of x86_64 Date: Fri, 2 Oct 2015 12:58:53 +0200 Message-ID: References: <1443780123-6493-1-git-send-email-alexinbeijing@gmail.com> <1443780123-6493-3-git-send-email-alexinbeijing@gmail.com> <20151002101921.GS8645@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e01160438a1ee0e05211d0c8d X-Trace: ger.gmane.org 1443783551 29448 80.91.229.3 (2 Oct 2015 10:59:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2015 10:59:11 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8612-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 02 12:59:10 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Zhy3P-0002oE-HN for gllmg-musl@m.gmane.org; Fri, 02 Oct 2015 12:59:07 +0200 Original-Received: (qmail 15460 invoked by uid 550); 2 Oct 2015 10:59:06 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 15438 invoked from network); 2 Oct 2015 10:59:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=AIAQHTdQDZmwV8tLechR6sIytc9qV+RBbM4l7rVY0LQ=; b=phzi79JUs/7ADMXw268ZlgwNs90ahZ1GjUBkQsbzHKA9z76/x8PcdoQWaTybnS9qyv Pwj9Qm3gr4l0tdnOMfe5BPQOQ9qOCZC7S761Qj2/1d3CPM5O74xTWCYGRk5txo7ceP1D mIw6UpUQ/VONySCx0cns1iyURtrfLHHOsh9omEsnYSKRc7QRsXqrSVj7mx3Tq05zC6Ye 9OBibnNd0qsdy91REWbyRaEsQIyzGZ1oAqd4FP6OEqs5UCF3t5Ig24jA9XD0HzWbO/4z r0Qw3sRdpL1hibTz/FJMdgjkiOkW0+xc4T5lKIn4VD+CST2ZLyxVnXdgeIi42oimy88p EM9w== X-Received: by 10.50.43.234 with SMTP id z10mr3591743igl.53.1443783533258; Fri, 02 Oct 2015 03:58:53 -0700 (PDT) In-Reply-To: <20151002101921.GS8645@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:8600 Archived-At: --089e01160438a1ee0e05211d0c8d Content-Type: text/plain; charset=UTF-8 On Fri, Oct 2, 2015 at 12:19 PM, Rich Felker wrote: > On Fri, Oct 02, 2015 at 12:02:03PM +0200, Alex Dowad wrote: > > +# this does NOT exhaustively check for all possible instructions which > could > > +# overwrite a register value inherited from the caller (just the common > ones) > > +/mov.*,%r(ax|bx|cx|dx|si|di|bp|8|9|10|11|12|13|14|15)/ { > trashed(get_reg2()) } > > +/(add|addl|sub|subl|and|or|xor|lea|sal|sar|shl|shr) > %r(ax|bx|cx|dx|si|di|bp|8|9|10|11|12|13|14|15),/ { > > + trashed(get_reg1()) > > +} > > This looks wrong but maybe it's already wrong in existing code. Why > are you marking the first operand as trashed rather than the second? You're absolutely right! --089e01160438a1ee0e05211d0c8d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Fri, Oct 2, 2015 at 12:19 PM, Rich Felker <dalias@libc.org> wrote:
On Fri, Oct 02,= 2015 at 12:02:03PM +0200, Alex Dowad wrote:
> +# this does NOT exhaustively check for all possible instructions whic= h could
> +# overwrite a register value inherited from the caller (just the comm= on ones)
> +/mov.*,%r(ax|bx|cx|dx|si|di|bp|8|9|10|11|12|13|14|15)/=C2=A0 { trashe= d(get_reg2()) }
> +/(add|addl|sub|subl|and|or|xor|lea|sal|sar|shl|shr) %r(ax|bx|cx|dx|si= |di|bp|8|9|10|11|12|13|14|15),/ {
> +=C2=A0 trashed(get_reg1())
> +}

This looks wrong but maybe it's already wrong in existing code. = Why
are you marking the first operand as trashed rather than the second?

You're absolutely right!=C2=A0
--089e01160438a1ee0e05211d0c8d--