[llvm-commits] [patch] fix the logic for ELF in X86Subtarget::GVRequiresExtraLoad

Rafael Espindola espindola at google.com
Fri May 30 10:29:29 PDT 2008


The attached patch makes sure we do not use the GOT for symbols that
are not externally visible. For example, it fixes:

; RUN: llvm-as < %s | \
; RUN:   llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
; RUN: grep {movl       a(%rip),} %t1
; RUN: not grep GOTPCREL %t1

@a = hidden global i32 0

define i32 @get_a() {
entry:
        %tmp1 = load i32* @a, align 4
        ret i32 %tmp1
}


Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm.patch
Type: text/x-patch
Size: 858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080530/c8e88019/attachment.bin>


More information about the llvm-commits mailing list