Check for objcopy in configure.ac and then mark binary data as read-only
by renaming .data to .rodata and setting the correct flags.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
src/%.bin.lo: src/%.bin
$(AM_V_GEN)$(LD) -r -o "src/$*.bin.o" -z noexecstack --format=binary "$<"
+ $(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)" >>"$@"
$(AM_V_at)echo "#" >>"$@"
# gles2 helpers
AM_CONDITIONAL([BUILD_HAVE_GLES2], [test "x$have_gles2" = "xyes"])
+# check for mandatory objcopy program
+AC_ARG_VAR([OBJCOPY], [objcopy program])
+AC_CHECK_TOOL([OBJCOPY], [objcopy], "")
+
+if test "x$OBJCOPY" = "x" ; then
+ AC_ERROR([Cannot find "objcopy" program])
+fi
+
#
# Makefile vars
# After everything is configured, we correctly substitute the values for the