Skip to content

Commit

Permalink
Merge pull request #1002 from ergrelet/fix_elf_has_nx
Browse files Browse the repository at this point in the history
Fix LIEF::ELF::Binary::has_nx
  • Loading branch information
romainthomas authored Dec 9, 2023
2 parents 8dd8a25 + 0c7c79b commit 3f2046e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ELF/Binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ bool Binary::is_pie() const {

bool Binary::has_nx() const {
if (const Segment* gnu_stack = get(SEGMENT_TYPES::PT_GNU_STACK)) {
return gnu_stack->has(ELF_SEGMENT_FLAGS::PF_X);
return !gnu_stack->has(ELF_SEGMENT_FLAGS::PF_X);
}

if (header().machine_type() == ARCH::EM_PPC64) {
Expand Down

0 comments on commit 3f2046e

Please sign in to comment.