Descriptioncmd/8l: fix misassembling of MOVB involving (AX)(BX*1)
The linker accepts MOVB involving non-byte-addressable
registers, by generating XCHG instructions to AX or BX.
It does not handle the case where nor AX nor BX are available.
See also revision 1470920a2804.
Assembling
TEXT ·Truc(SB),7,$0
MOVB BP, (BX)(AX*1)
RET
gives before:
08048c60 <main.Truc>:
8048c60: 87 dd xchg %ebx,%ebp
8048c62: 88 1c 03 mov %bl,(%ebx,%eax,1)
8048c65: 87 dd xchg %ebx,%ebp
8048c67: c3 ret
and after:
08048c60 <main.Truc>:
8048c60: 87 cd xchg %ecx,%ebp
8048c62: 88 0c 03 mov %cl,(%ebx,%eax,1)
8048c65: 87 cd xchg %ecx,%ebp
8048c67: c3 ret
Patch Set 1 #Patch Set 2 : diff -r 85014abe1574 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r 85014abe1574 https://go.googlecode.com/hg/ #
Total comments: 4
Patch Set 4 : diff -r 84f3f82c91fa https://go.googlecode.com/hg/ #Patch Set 5 : diff -r 84f3f82c91fa https://go.googlecode.com/hg/ #MessagesTotal messages: 4
|