[LLVMdev] implementing PIC for linux x86-64

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


> Right, this is just optimization. AFAIR, current code already does this
> for 'normal' PIC - it just checks for linkage and doesn't assemble call
> via PLT for stuff with internal linkage.

It is not using the PLT even for externally visible ones. Try

; RUN: llvm-as < %s | \
; RUN:   llc -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1 -f
; RUN: grep {call       f at plt} %t1

define void @g() {
entry:
        call void @f( )
        ret void
}

declare void @f()


Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047



More information about the llvm-dev mailing list