Hello, Rafael> On linux X86_64, calls to local but externally visible functions > should use the PLT. Access to local (same compilation unit), variables > can just use RIP relative access.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.> Looks like we need a second variable (say PICCallStyle). With it we > would have something like:This seems to be PIC vs Dynamic-No-PIC relocation style issue, I don't see, why something new is needed here. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University.
> 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
Reasonably Related Threads
- [LLVMdev] implementing PIC for linux x86-64
- [LLVMdev] [patch] add support for PIC on linux x86-64
- [LLVMdev] [patch] add support for PIC on linux x86-64
- [LLVMdev] [patch] add support for PIC on linux x86-64
- [LLVMdev] CVS binutils includes support for plugins, can use the llvm plugin.