From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8605 Path: news.gmane.org!not-for-mail From: Alex Dowad Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH 4/5] In i386 CFI script, binary ops like ADD, AND, etc. modify the 2nd operand, not 1st Date: Fri, 2 Oct 2015 13:32:35 +0200 Message-ID: <1443785556-27473-4-git-send-email-alexinbeijing@gmail.com> References: <1443785556-27473-1-git-send-email-alexinbeijing@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1443785624 30994 80.91.229.3 (2 Oct 2015 11:33:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2015 11:33:44 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8617-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 02 13:33:44 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 1Zhyaq-0004JJ-Vo for gllmg-musl@m.gmane.org; Fri, 02 Oct 2015 13:33:41 +0200 Original-Received: (qmail 18048 invoked by uid 550); 2 Oct 2015 11:33:32 -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 15746 invoked from network); 2 Oct 2015 11:33:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=rFe8j5OPIZAaSwsTEURtZVZ9wfHv7tLSyh0uAhH7FKA=; b=v7LpBgvqnMrSXmA16M5EmN384Kp7MRYE5j8A3RZ5vIo7tdOs8TToHmcKr5VPnTIQn6 NapIduN/PJ2MLqngZxrBD4ZRP43d5h6FM/mnFQGKWSn5LpDuTva04vupuLrY20n9oijW /xQO9ySGR0O4pwHMHvqCg4LXhSSG21nK8Ij78wwoV6MQP3g1vEttKCLKxbZ3XDls8uJ7 ZoGGSJl4GhHhhGIQhleH2kRNKD/ATdr5CH1qNl8MJRAqV2ITychdfN13F9CwGoOIqzwt yX/buFe69F3nc5vhdcQkHoMNoC0x04DxOoS5nHdXyuBZueE6acylp2dvj5gA3hth0NeV EG+w== X-Received: by 10.180.35.163 with SMTP id i3mr3562202wij.80.1443785568917; Fri, 02 Oct 2015 04:32:48 -0700 (PDT) X-Mailer: git-send-email 2.0.0.GIT In-Reply-To: <1443785556-27473-1-git-send-email-alexinbeijing@gmail.com> Xref: news.gmane.org gmane.linux.lib.musl.general:8605 Archived-At: Thanks to Rich Felker for noticing my mistake here! --- tools/add-cfi.i386.awk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/add-cfi.i386.awk b/tools/add-cfi.i386.awk index 5dc8794..fc0d8cf 100644 --- a/tools/add-cfi.i386.awk +++ b/tools/add-cfi.i386.awk @@ -185,12 +185,12 @@ function trashed(register) { # this does NOT exhaustively check for all possible instructions which could # overwrite a register value inherited from the caller (just the common ones) /mov.*,%e(ax|bx|cx|dx|si|di|bp)/ { trashed(get_reg2()) } -/(add|addl|sub|subl|and|or|xor|lea|sal|sar|shl|shr) %e(ax|bx|cx|dx|si|di|bp),/ { - trashed(get_reg1()) +/(add|addl|sub|subl|and|or|xor|lea|sal|sar|shl|shr).*,%e(ax|bx|cx|dx|si|di|bp)/ { + trashed(get_reg2()) } -/^i?mul [^,]*$/ { trashed("eax"); trashed("edx") } -/^i?mul %e(ax|bx|cx|dx|si|di|bp),/ { trashed(get_reg1()) } -/^i?div/ { trashed("eax"); trashed("edx") } +/^i?mul [^,]*$/ { trashed("eax"); trashed("edx") } +/^i?mul.*,%e(ax|bx|cx|dx|si|di|bp)/ { trashed(get_reg2()) } +/^i?div/ { trashed("eax"); trashed("edx") } /(dec|inc|not|neg|pop) %e(ax|bx|cx|dx|si|di|bp)/ { trashed(get_reg()) } /cpuid/ { trashed("eax"); trashed("ebx"); trashed("ecx"); trashed("edx") } -- 2.0.0.GIT