[llvm] r298302 - [Fuchsia] Use %gs for ABI slots under -mcmodel=kernel
Evgeniy Stepanov via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 20 13:35:38 PDT 2017
Author: eugenis
Date: Mon Mar 20 15:35:37 2017
New Revision: 298302
URL: http://llvm.org/viewvc/llvm-project?rev=298302&view=rev
Log:
[Fuchsia] Use %gs for ABI slots under -mcmodel=kernel
Make x86_64-fuchsia targets under -mcmodel=kernel use %gs rather
than %fs to access ABI slots for stack-protector and safe-stack
Patch by Roland McGrath.
Differential Revision: https://reviews.llvm.org/D30870
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=298302&r1=298301&r2=298302&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Mar 20 15:35:37 2017
@@ -2077,7 +2077,7 @@ Value *X86TargetLowering::getIRStackGuar
if (hasStackGuardSlotTLS(Subtarget.getTargetTriple())) {
if (Subtarget.isTargetFuchsia()) {
// <magenta/tls.h> defines MX_TLS_STACK_GUARD_OFFSET with this value.
- return SegmentOffset(IRB, 0x10, 257);
+ return SegmentOffset(IRB, 0x10, getAddressSpace());
} else {
// %fs:0x28, unless we're using a Kernel code model, in which case
// it's %gs:0x28. gs:0x14 on i386.
@@ -2142,7 +2142,7 @@ Value *X86TargetLowering::getSafeStackPo
// Fuchsia is similar.
if (Subtarget.isTargetFuchsia()) {
// <magenta/tls.h> defines MX_TLS_UNSAFE_SP_OFFSET with this value.
- return SegmentOffset(IRB, 0x18, 257);
+ return SegmentOffset(IRB, 0x18, getAddressSpace());
}
return TargetLowering::getSafeStackPointerLocation(IRB);
More information about the llvm-commits
mailing list