From dee2cf67eafd0313a5f0f163b9cbe6c71228ae34 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Wed, 27 Sep 2017 19:34:00 +0000 Subject: [CodeGen] Emit necessary .note sections for -fsplit-stack Summary: According to https://gcc.gnu.org/wiki/SplitStacks, the linker expects a zero-sized .note.GNU-split-stack section if split-stack is used (and also .note.GNU-no-split-stack section if it also contains non-split-stack functions), so it can handle the cases where a split-stack function calls non-split-stack function. This change adds the sections if needed. Fixes PR #34670. Reviewers: thanm, rnk, luqmana Reviewed By: rnk Subscribers: llvm-commits Patch by Cherry Zhang Differential Revision: https://reviews.llvm.org/D38051 llvm-svn: 314335 --- llvm/lib/CodeGen/MachineModuleInfo.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp') diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index f0dd77ef0dae..4cedcd03a2d5 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -208,6 +208,7 @@ bool MachineModuleInfo::doInitialization(Module &M) { ObjFileMMI = nullptr; CurCallSite = 0; DbgInfoAvailable = UsesVAFloatArgument = UsesMorestackAddr = false; + HasSplitStack = HasNosplitStack = false; AddrLabelSymbols = nullptr; TheModule = &M; return false; -- cgit v1.2.3