[PATCH] D19226: [X86] enable PIE for functions
Asaf Badouh via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 19 09:24:33 PDT 2016
AsafBadouh added inline comments.
================
Comment at: ../llvmOrg/lib/Target/X86/X86Subtarget.h:559
@@ +558,3 @@
+ /// for the current subtarget.
+ /// isFast - indicate fastLowerCall, ignore NonLazyBind attribute
+ unsigned char classifyGlobalFunctionReference(const GlobalValue *GV,
----------------
rnk wrote:
> Changing fastLowerCall seems nice, it keeps the complexity of what FastISel does local to itself.
NP, will upload fix for that shortly.
================
Comment at: ../llvmOrg/test/CodeGen/X86/pie.ll:7
@@ +6,3 @@
+; CHECK-LABEL: bar:
+; CHECK: call{{l|q}} foo
+; CHECK: call{{l|q}} weak_odr_foo{{$}}
----------------
rnk wrote:
> Should this be foo{{$}}?
yes!
================
Comment at: ../llvmOrg/test/CodeGen/X86/pie.ll:9
@@ +8,3 @@
+; CHECK: call{{l|q}} weak_odr_foo{{$}}
+; CHECK: call{{l|q}} weak_foo{{$}}
+; CHECK: call{{l|q}} internal_foo{{$}}
----------------
rnk wrote:
> Interesting. I would've expected a PLT call for such weak functions so that they can be provided by libraries, but it seems you cannot override a non-ODR weak function from an executable with GCC.
>
> GCC generates a direct, non-PLT call in non-PIE mode, and a PLT call with -fPIE. I'm guessing they just don't do this optimization yet.
I think they do have it in GCC5.3
Repository:
rL LLVM
http://reviews.llvm.org/D19226
More information about the llvm-commits
mailing list