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

            Bug ID: 21168
           Summary: ld should allow "lea foo@GOT, %ecx"
           Product: binutils
           Version: 2.29 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---
            Target: i386-elf

[hjl@gnu-6 xxxx]$ cat x.S 
        .text
        .globl  bar
        .type   bar, @function
bar:
        call    __x86.get_pc_thunk.ax
        addl    $_GLOBAL_OFFSET_TABLE_, %eax
        lea     foo@GOT, %ecx
        mov     (%eax,%ecx,1), %eax
        ret
        .section       
.text.__x86.get_pc_thunk.ax,"axG",@progbits,__x86.get_pc_thunk.ax,comdat
        .globl  __x86.get_pc_thunk.ax
        .hidden __x86.get_pc_thunk.ax
        .type   __x86.get_pc_thunk.ax, @function
__x86.get_pc_thunk.ax:
        movl    (%esp), %eax
        ret
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-6 xxxx]$ make libx.so
gcc -B./ -m32    -c -o x.o x.S
./ld -melf_i386 -shared -o libx.so x.o
./ld: x.o: direct GOT relocation R_386_GOT32 against `foo' without base
register can not be used when making a shared object
./ld: final link failed: Bad value
Makefile:28: recipe for target 'libx.so' failed
make: *** [libx.so] Error 1
[hjl@gnu-6 xxxx]$ 

Here "lea foo@GOT, %ecx" is OK.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to