From 890b87b3524d9fef0cdaf67628cea232c638088f Mon Sep 17 00:00:00 2001 From: guenther Date: Tue, 26 Jul 2016 02:38:12 +0000 Subject: [PATCH] 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@ --- gnu/usr.bin/binutils-2.17/bfd/elf.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.20.1