From 7a64f5a180e8b77b13e8ae8d25fb08d8c58f93af Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 29 May 2017 14:37:52 +0000 Subject: openbsd does not use nonexec stack segment header hints. in fact, false is a much better default for UsesNonexecutableStackSection. platforms that require it can reenable, instead, saving the rest of us an unnecessary program header (causes trouble for some special binaries). ok kettenis --- gnu/llvm/lib/MC/MCAsmInfoELF.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gnu/llvm/lib/MC/MCAsmInfoELF.cpp b/gnu/llvm/lib/MC/MCAsmInfoELF.cpp index 2bff6e05966..dcd6cea682d 100644 --- a/gnu/llvm/lib/MC/MCAsmInfoELF.cpp +++ b/gnu/llvm/lib/MC/MCAsmInfoELF.cpp @@ -21,6 +21,8 @@ using namespace llvm; void MCAsmInfoELF::anchor() { } MCSection *MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const { + if (!UsesNonexecutableStackSection) + return nullptr; return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS, 0); } @@ -29,4 +31,5 @@ MCAsmInfoELF::MCAsmInfoELF() { WeakRefDirective = "\t.weak\t"; PrivateGlobalPrefix = ".L"; PrivateLabelPrefix = ".L"; + UsesNonexecutableStackSection = false; } -- cgit v1.2.3