//./clang-3.8 -c a.S -m32 -save-temps //a.S is this: .section .text .global _start _start: //GCC accept this //bound %eax, (%ecx) //CLANG wants this bound (%ecx), %eax //both generate: //62 01 bound %eax,(%ecx)
/tmp/xxxx/bin $ ./llvm-objdump -d a.o a.o: file format ELF32-i386 Disassembly of section .text: _start: ./llvm-objdump: warning: invalid instruction encoding /tmp/xxxx/bin $ objdump -d a.o a.o: file format elf32-i386 Disassembly of section .text: 00000000 <_start>: 0: 62 01 bound %eax,(%ecx)
Hi again, I found this in GAS, tc-i386.c /* All intel opcodes have reversed operands except for "bound" and "enter". We also don't reverse intersegment "jmp" and "call" instructions with 2 immediate operands so that the immediate segment precedes the offset, as it does when in AT&T mode. */ Plus according to and source it seems that also INVLPGA could have similar problem. See https://sourceware.org/binutils/docs/as/i386_002dVariations.html Thanks, Rudolf
Change approved: https://reviews.llvm.org/D43243
Fixed in r325178