mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-04 17:56:53 +00:00
[CodeGen] Change getSDagStackGuard to get an internal sym.
Fixes a crash in the backend during an LTO build of rtld(1) in FreeBSD. llvm-svn: 272262
This commit is contained in:
parent
62d5d2ff36
commit
74d4553b12
@ -1831,7 +1831,7 @@ void TargetLoweringBase::insertSSPDeclarations(Module &M) const {
|
||||
// Currently only support "standard" __stack_chk_guard.
|
||||
// TODO: add LOAD_STACK_GUARD support.
|
||||
Value *TargetLoweringBase::getSDagStackGuard(const Module &M) const {
|
||||
return M.getGlobalVariable("__stack_chk_guard");
|
||||
return M.getGlobalVariable("__stack_chk_guard", true);
|
||||
}
|
||||
|
||||
Value *TargetLoweringBase::getSSPStackGuardCheck(const Module &M) const {
|
||||
|
13
test/CodeGen/Generic/stackguard-internal.ll
Normal file
13
test/CodeGen/Generic/stackguard-internal.ll
Normal file
@ -0,0 +1,13 @@
|
||||
; Check that the backend doesn't crash.
|
||||
; RUN: llc -mtriple=x86_64-pc-freebsd %s -o - | FileCheck %s
|
||||
|
||||
@__stack_chk_guard = internal global [8 x i64] zeroinitializer, align 16
|
||||
|
||||
define void @f() sspstrong {
|
||||
%tbl = alloca [4 x i64], align 16
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: .type __stack_chk_guard,@object
|
||||
; CHECK: .local __stack_chk_guard
|
||||
; CHECK: .comm __stack_chk_guard,64,16
|
Loading…
Reference in New Issue
Block a user