<p dir="ltr"><br>
On Feb 27, 2016 6:07 PM, "Hlide via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Is there any reason to prefer a NEAR jump to a SHORT jump if the assembler deemed it is okay to keep it as a SHORT one?<br>
><br>
> The only reason you may want to have it as a NEAR jump is because you need to alter the target of this jump to another address which may be out of a byte range.</p>
<p dir="ltr">The problem is that llvm-mc always compiles "jmp" this as short jump, no matter where the target is. Hence my question. I dont know if there is any way to change this behavior. Looks like a bug to me so far.<br></p>
<p dir="ltr">Craig said there is a trick with object file, but I dont know how to do that. Also, why compiling to object file changes the result?<br></p>
<p dir="ltr">Thanks.<br><br><br><br><br><br></p>
<p dir="ltr">><br>
> Regards<br>
><br>
><br>
> On 27/02/2016 06:00:54, Jun Koi via llvm-dev (<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>) wrote:<br>
> > Hi,<br>
> ><br>
> ><br>
> > Currently X86 assembler seems to always compile "jmp _label" as a SHORT<br>
> > jump with "EB" opcode:<br>
> ><br>
> > $ echo "jmp _label"|llvm-mc -assemble -triple=i386 -show-encoding<br>
> > .text<br>
> > jmp _label # encoding: [0xeb,A]<br>
> ><br>
> ><br>
> ><br>
> > My question is: can X86 assembler supports NEAR jump with opcode "E9"?<br>
> > I try with "near" keyword, but it is not accepted:<br>
> ><br>
> > $ echo "jmp near _label"|llvm-mc -assemble -triple=i386 -show-encoding<br>
> > .text<br>
> > <stdin>:1:10: error: unexpected token in argument list<br>
> > jmp near _label<br>
> > ^<br>
> ><br>
> ><br>
> ><br>
> > Thanks,<br>
> ><br>
> > Jun<br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</p>