Commit c77cbbcd authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

Test if we need to put the .type directive inside a .def directive.

parent e38b4191
......@@ -454,6 +454,25 @@ int main(void) {
fi
fi
dnl **** Check if we need to place .type inside a .def directive ****
AC_CACHE_CHECK("whether .type must sit inside a .def directive",
ac_cv_c_type_in_def,
[saved_libs=$LIBS
LIBS="conftest_asm.s $LIBS"
cat > conftest_asm.s <<EOF
.globl _ac_test
.def _ac_test; .scl 2; .type 32; .endef
_ac_test:
.long 0
EOF
AC_TRY_LINK(,,ac_cv_c_type_in_def="yes",ac_cv_c_type_in_def="no")
LIBS=$saved_libs])
if test "$ac_cv_c_type_in_def" = "yes"
then
AC_DEFINE(NEED_TYPE_IN_DEF)
fi
dnl **** Check for underscore on external symbols ****
AC_CACHE_CHECK("whether external symbols need an underscore prefix",
......
......@@ -3,6 +3,9 @@
* defined in the 'configure' script.
*/
/* Define if .type asm directive must be inside a .def directive */
#undef NEED_TYPE_IN_DEF
/* Define if symbols declared in assembly code need an underscore prefix */
#undef NEED_UNDERSCORE_PREFIX
......
......@@ -47,6 +47,9 @@
/* Define if lex declares yytext as a char * by default, not a char[]. */
#undef YYTEXT_POINTER
/* Define if .type asm directive must be inside a .def directive */
#undef NEED_TYPE_IN_DEF
/* Define if symbols declared in assembly code need an underscore prefix */
#undef NEED_UNDERSCORE_PREFIX
......
......@@ -721,11 +721,17 @@ typedef HANDLE *PHANDLE;
# define __ASM_NAME(name) name
#endif
#ifdef NEED_TYPE_IN_DEF
# define __ASM_TYPE(name) ".def " __ASM_NAME(#name) "; .scl 2; .type 32; .endef\n"
#else
# define __ASM_TYPE(name) ".type " __ASM_NAME(#name) ",@function\n"
#endif
#ifdef __GNUC__
# define __ASM_GLOBAL_FUNC(name,code) \
__asm__( ".align 4\n\t" \
".globl " __ASM_NAME(#name) "\n\t" \
".type " __ASM_NAME(#name) ",@function\n" \
__ASM_TYPE(name) \
__ASM_NAME(#name) ":\n\t" \
code );
#else /* __GNUC__ */
......@@ -733,7 +739,7 @@ typedef HANDLE *PHANDLE;
void __asm_dummy_##name(void) { \
asm( ".align 4\n\t" \
".globl " __ASM_NAME(#name) "\n\t" \
".type " __ASM_NAME(#name) ",@function\n" \
__ASM_TYPE(name) \
__ASM_NAME(#name) ":\n\t" \
code ); \
}
......
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