[PATCH] D68907: [6/7/trunk] -fno-plt generates wrong relocation for std::ios_base::Init leading to segmentation fault
kamlesh kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 12 03:47:28 PDT 2019
kamleshbhalui created this revision.
kamleshbhalui added a reviewer: craig.topper.
kamleshbhalui added a project: LLVM.
Herald added a subscriber: hiraditya.
Fixes this
https://bugs.llvm.org/show_bug.cgi?id=39252
Repository:
rL LLVM
https://reviews.llvm.org/D68907
Files:
llvm/lib/Target/X86/X86Subtarget.cpp
Index: llvm/lib/Target/X86/X86Subtarget.cpp
===================================================================
--- llvm/lib/Target/X86/X86Subtarget.cpp
+++ llvm/lib/Target/X86/X86Subtarget.cpp
@@ -337,10 +337,10 @@
InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),
FrameLowering(*this, getStackAlignment()) {
// Determine the PICStyle based on the target selected.
- if (!isPositionIndependent())
+ if (is64Bit())
+ setPICStyle(PICStyles::RIPRel);
+ else if (!isPositionIndependent())
setPICStyle(PICStyles::None);
- else if (is64Bit())
- setPICStyle(PICStyles::RIPRel);
else if (isTargetCOFF())
setPICStyle(PICStyles::None);
else if (isTargetDarwin())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68907.224733.patch
Type: text/x-patch
Size: 720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191012/17fb4534/attachment.bin>
More information about the llvm-commits
mailing list