bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/11037] New: invalid code generation depending on code posi


From: serpilliere at droids-corp dot org
Subject: [Bug binutils/11037] New: invalid code generation depending on code position
Date: 1 Dec 2009 09:06:58 -0000

good code:

.intel_syntax
.globl main
main:
        jmp     DWORD PTR[ %edx + var_1 - 0x1000 ]
var_1:
        .byte 0x11, 0x22, 0x33, 0x44

code generated: (objdump rip)

08048394 <main>:
 8048394:       ff a2 9a 73 04 08       jmp    *0x804739a(%edx)
0804839a <var_1>:
...
the jmp correctly references var_1 - 0x1000 (0804839a -0x1000 = 0x804739a)

but modified code: 

.intel_syntax
.globl main
var_1:
        .byte 0x11, 0x22, 0x33, 0x44
main:
        jmp     DWORD PTR[ %edx + var_1 - 0x1000 ]

code generated: (objdump rip)
08048394 <var_1>:
 8048394:       11 22
 8048396:       33 44

08048398 <main>:
 8048398:       ff a2 94 83 04 08       jmp    *0x8048394(%edx)

the jmp directly accesses var_1 

it seems to forget to add -0x1000 to memory deref

$ as --version
GNU assembler (GNU Binutils for Debian) 2.20

-- 
           Summary: invalid code generation depending on code position
           Product: binutils
           Version: 2.20
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: serpilliere at droids-corp dot org
                CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=11037

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]