mirror of
https://github.com/intel/llvm.git
synced 2026-02-07 16:11:27 +08:00
[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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user