diff options
author | George Rimar <grimar@accesssoftek.com> | 2015-11-14 20:56:08 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2015-11-14 20:56:08 +0000 |
commit | 03220309e12078c2a35fc39c2bb9baf39aac225d (patch) | |
tree | 4b569fa9f5b8034502fefe175db8d1bf3a168c2c /lld/ELF/InputFiles.cpp | |
parent | 0de179b23b79706347c730976987dc6a251d6b9f (diff) | |
download | bcm5719-llvm-03220309e12078c2a35fc39c2bb9baf39aac225d.tar.gz bcm5719-llvm-03220309e12078c2a35fc39c2bb9baf39aac225d.zip |
[ELF2] - Implemented PT_GNU_STACK support, -z execstack option.
PT_GNU_STACK is a entry in the elf file format which contains the access rights (read, write, execute) of the stack,
it is always generated now. By default stack is not executable in this implementation.
-z execstack can be used to make executable.
Differential revision: http://reviews.llvm.org/D14571
llvm-svn: 253145
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
-rw-r--r-- | lld/ELF/InputFiles.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 4f5eb19dfec..05e1f7b9aa5 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -219,7 +219,9 @@ void elf2::ObjectFile<ELFT>::initializeSections(DenseSet<StringRef> &Comdats) { default: { ErrorOr<StringRef> NameOrErr = this->ELFObj.getSectionName(&Sec); error(NameOrErr); - if (*NameOrErr == ".eh_frame") + if (*NameOrErr == ".note.GNU-stack") + Sections[I] = &InputSection<ELFT>::Discarded; + else if (*NameOrErr == ".eh_frame") Sections[I] = new (this->Alloc) EHInputSection<ELFT>(this, &Sec); else if (shouldMerge<ELFT>(Sec)) Sections[I] = new (this->Alloc) MergeInputSection<ELFT>(this, &Sec); |