From: guenther Date: Tue, 26 Jul 2016 02:38:12 +0000 (+0000) Subject: Make sure there's space for the PT_OPENBSD_WXNEEDED segment, if requested X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=890b87b3524d9fef0cdaf67628cea232c638088f;p=openbsd Make sure there's space for the PT_OPENBSD_WXNEEDED segment, if requested problem noted by Juan Francisco Cantero Hurtado (iam (at) juanfra.info) ok deraadt@ --- diff --git a/gnu/usr.bin/binutils-2.17/bfd/elf.c b/gnu/usr.bin/binutils-2.17/bfd/elf.c index c73238b0c28..2e874b8d166 100644 --- a/gnu/usr.bin/binutils-2.17/bfd/elf.c +++ b/gnu/usr.bin/binutils-2.17/bfd/elf.c @@ -4731,6 +4731,12 @@ get_program_header_size (bfd *abfd) ++segs; } + if (elf_tdata (abfd)->wxneeded) + { + /* We need a PT_OPENBSD_WXNEEDED segment. */ + ++segs; + } + for (s = abfd->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LOAD) != 0