From a0cb51a98a0e27425572a5157bcb0f4a5ed927a2 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 17 Mar 2014 20:23:35 +0100 Subject: [PATCH] build: avoid executable stack -z execstack alone is not sufficient for proper .note.GNU-stack to be generated when converting from binary, at the very least with binutils-2.23.2 and elf-x86_64. We need to ensure the section actually gets included. Signed-off-by: Lubomir Rintel --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index f82e0a1..891cb4b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -130,7 +130,7 @@ GITHEAD:=$(shell $(emptyvariable)"$(srcdir)/src/genversion.sh" "$(srcdir)/src/sh CLEANFILES += src/*.bin.lo src/*.bin.o src/%.bin.lo: src/%.bin - $(AM_V_GEN)$(LD) -r -o "src/$*.bin.o" -z noexecstack --format=binary "$<" + $(AM_V_GEN)$(LD) -r -o "src/$*.bin.o" -z noexecstack --format=binary --section-start=.note.GNU-stack=0 "$<" $(AM_V_at)$(OBJCOPY) --rename-section .data=.rodata,alloc,load,readonly,data,contents "src/$*.bin.o" $(AM_V_at)echo "# $@ - a libtool object file" >"$@" $(AM_V_at)echo "# Generated by $(shell $(LIBTOOL) --version | head -n 1)" >>"$@" -- 1.8.5.3