bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/17640] New: [i386] Convert load to lea


From: hjl.tools at gmail dot com
Subject: [Bug gold/17640] New: [i386] Convert load to lea
Date: Mon, 24 Nov 2014 15:58:35 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=17640

            Bug ID: 17640
           Summary: [i386] Convert load to lea
           Product: binutils
           Version: 2.26 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at google dot com
          Reporter: hjl.tools at gmail dot com
                CC: ian at airs dot com

For i386, we should convert

    mov address@hidden(%reg), %reg

to

   lea address@hidden(%reg), %reg

if foo is a local symbol.  This is the result from ld:

address@hidden lea-1]$ cat lea2.s
    .text
    .type    foo, @function
foo:
    ret
    .size    foo, .-foo
    .globl    bar
    .type    bar, @function
bar:
    movl    address@hidden(%ecx), %eax
    .size    bar, .-bar
address@hidden lea-1]$ gcc -c -m32 lea2.s
address@hidden lea-1]$ ld -m elf_i386 -shared lea2.o
address@hidden lea-1]$ objdump -dw a.out 

a.out:     file format elf32-i386


Disassembly of section .text:

00000129 <foo>:
 129:    c3                       ret    

0000012a <bar>:
 12a:    8d 81 a1 ef ff ff        lea    -0x105f(%ecx),%eax
address@hidden lea-1]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

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