http://sourceware.org/bugzilla/show_bug.cgi?id=12687
Summary: Incorrect jump address for backward local labels with Intel syntax Product: binutils Version: 2.22 (HEAD) Status: NEW Severity: normal Priority: P2 Component: gas AssignedTo: unassig...@sources.redhat.com ReportedBy: m8r-oq0...@mailinator.com Created attachment 5679 --> http://sourceware.org/bugzilla/attachment.cgi?id=5679 A test for backward local labels with Intel syntax File test.asm: .intel_syntax mov eax, 5 1: dec eax jnz 1b ret Command line (under MinGW): as test.asm -o test.o ld test.o -o test.exe Actual result: jump two bytes forward. 00401000 B8 05000000 mov eax,5 00401005 48 dec eax 00401006 +--- 75 02 jne short test.0040100A ; error 00401008 | C3 ret 00401009 | 90 nop 0040100A +-> 90 nop Expected result: jump three bytes back: 00401000 B8 05000000 mov eax,5 00401005 +-> 48 dec eax 00401006 +--- 75 FD jne short test.00401005 00401008 C3 ret Additional information If you specify -a switch (as test.asm -o test.o -a), the bug disappears. If you rewrite the assembly code using AT&T syntax, it also disappears: mov $5, %eax 1: dec %eax jnz 1b ret I checked the object file (test.o) generated by the GNU Assembler and found the erroneous jump address in it (so it's not a linker bug). -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils