OSDN Git Service

[CodeGen] Emit necessary .note sections for -fsplit-stack
authorThan McIntosh <thanm@google.com>
Wed, 27 Sep 2017 19:34:00 +0000 (19:34 +0000)
committerThan McIntosh <thanm@google.com>
Wed, 27 Sep 2017 19:34:00 +0000 (19:34 +0000)
commit3962d561a63fb3912c9310838793863ce5818cba
treec1d4e63327feadccdfd009ffa32fa249390d68fc
parent468b64ac6c5a04d0616b52a7e5d0e3053a773eee
[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 <cherryyz@google.com>

Differential Revision: https://reviews.llvm.org/D38051

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314335 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineModuleInfo.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/MachineModuleInfo.cpp
lib/CodeGen/PrologEpilogInserter.cpp
test/CodeGen/X86/segmented-stacks.ll