Commit d56b4410 authored by Niels Möller's avatar Niels Möller

Let configure set ASM_TYPE_PROGBITS, and use it for ASM_MARK_NOEXEC_STACK.

parent 71e778e3
2013-02-06 Niels Möller <nisse@lysator.liu.se>
* config.m4.in: Substitute ASM_TYPE_PROGBITS as TYPE_PROGBITS.
* config.make.in: Added .s to the suffix list.
* Makefile.in (.asm.s): Use a separate make target for .asm
......@@ -11,6 +13,10 @@
(asm.d): Make config.status write dependencies for .s files into
asm.d.
(ASM_ALIGN_LOG): Set to "no" when appropriate.
(ASM_TYPE_FUNCTION): Default to "@function".
(ASM_TYPE_PROGBITS): New substituted variable, set in the same way
as ASM_TYPE_FUNCTION.
(ASM_MARK_NOEXEC_STACK): Use TYPE_PROGBITS.
* asm.m4: Use changecom to disable m4 quoting. Use divert to
suppress output.
......
......@@ -2,6 +2,7 @@ define(<srcdir>, <<@srcdir@>>)dnl
define(<C_NAME>, <@ASM_SYMBOL_PREFIX@><$1>)dnl
define(<ELF_STYLE>, <@ASM_ELF_STYLE@>)dnl
define(<TYPE_FUNCTION>, <@ASM_TYPE_FUNCTION@>)dnl
define(<TYPE_PROGBITS>, <@ASM_TYPE_PROGBITS@>)dnl
define(<ALIGN_LOG>, <@ASM_ALIGN_LOG@>)dnl
define(<ALIGNOF_UINT64_T>, <@ALIGNOF_UINT64_T@>)dnl
define(<W64_ABI>, <@W64_ABI@>)dnl
......
......@@ -386,7 +386,9 @@ AC_SUBST([CCPIC_MAYBE])
ASM_SYMBOL_PREFIX=''
ASM_ELF_STYLE='no'
ASM_TYPE_FUNCTION=''
# GNU as default is to use @
ASM_TYPE_FUNCTION='@function'
ASM_TYPE_PROGBITS='@progbits'
ASM_MARK_NOEXEC_STACK=''
ASM_ALIGN_LOG=''
......@@ -410,29 +412,6 @@ if test x$enable_assembler = xyes ; then
ASM_SYMBOL_PREFIX='_'
fi
AC_CACHE_CHECK([if we should use a .note.GNU-stack section],
nettle_cv_asm_gnu_stack,
[ # Default
nettle_cv_asm_gnu_stack=no
cat >conftest.c <<EOF
int foo() { return 0; }
EOF
nettle_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >conftest.out 2>&1"
if AC_TRY_EVAL(nettle_compile); then
cat conftest.out >&AC_FD_CC
$OBJDUMP -x conftest.o | grep '\.note\.GNU-stack' > /dev/null \
&& nettle_cv_asm_gnu_stack=yes
else
cat conftest.out >&AC_FD_CC
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.s >&AC_FD_CC
fi
rm -f conftest.*])
if test x$nettle_cv_asm_gnu_stack = xyes ; then
ASM_MARK_NOEXEC_STACK='.section .note.GNU-stack,"",@progbits'
fi
AC_CACHE_CHECK([for ELF-style .type,%function pseudo-ops],
[nettle_cv_asm_type_percent_function],
[GMP_TRY_ASSEMBLE([
......@@ -465,12 +444,38 @@ foo:
if test x$nettle_cv_asm_type_percent_function = xyes ; then
ASM_ELF_STYLE='yes'
ASM_TYPE_FUNCTION='%function'
ASM_TYPE_PROGBITS='%progbits'
else
if test x$nettle_cv_asm_type_hash_function = xyes ; then
ASM_ELF_STYLE='yes'
ASM_TYPE_FUNCTION='#function'
ASM_TYPE_PROGBITS='#progbits'
fi
fi
AC_CACHE_CHECK([if we should use a .note.GNU-stack section],
nettle_cv_asm_gnu_stack,
[ # Default
nettle_cv_asm_gnu_stack=no
cat >conftest.c <<EOF
int foo() { return 0; }
EOF
nettle_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >conftest.out 2>&1"
if AC_TRY_EVAL(nettle_compile); then
cat conftest.out >&AC_FD_CC
$OBJDUMP -x conftest.o | grep '\.note\.GNU-stack' > /dev/null \
&& nettle_cv_asm_gnu_stack=yes
else
cat conftest.out >&AC_FD_CC
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.s >&AC_FD_CC
fi
rm -f conftest.*])
if test x$nettle_cv_asm_gnu_stack = xyes ; then
ASM_MARK_NOEXEC_STACK='.section .note.GNU-stack,"",TYPE_PROGBITS'
fi
AC_CACHE_CHECK([if .align assembly directive is logarithmic],
[nettle_cv_asm_align_log],
[GMP_TRY_ASSEMBLE([
......@@ -484,6 +489,7 @@ fi
AC_SUBST(ASM_SYMBOL_PREFIX)
AC_SUBST(ASM_ELF_STYLE)
AC_SUBST(ASM_TYPE_FUNCTION)
AC_SUBST(ASM_TYPE_PROGBITS)
AC_SUBST(ASM_MARK_NOEXEC_STACK)
AC_SUBST(ASM_ALIGN_LOG)
AC_SUBST(W64_ABI)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment