|
Message-ID: <CACsECNcP8_Fo8DkQ=JJ3gNQKQ5+dZOAJFQLFrtoa1doff=k6og@mail.gmail.com>
Date: Fri, 2 Oct 2015 13:01:40 +0200
From: Alex <alexinbeijing@...il.com>
To: musl@...ts.openwall.com
Subject: Re: [PATCH 3/3] Add script to add CFI directives to asm files
in debug builds of x86_64
On Fri, Oct 2, 2015 at 12:58 PM, Alex <alexinbeijing@...il.com> wrote:
>
> On Fri, Oct 2, 2015 at 12:19 PM, Rich Felker <dalias@...c.org> 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!
>
I'm pretty sure the reason I made this mistake was because of reading
Intel's developer manuals, where they write the destination register as the
first operand, and then absentmindedly applying the GNU syntax used by musl.
Content of type "text/html" skipped
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.