[HAVE_WEAK_SYMBOLS] (_weak_extern): Define using _Pragma(weak ...).

This commit is contained in:
Ulrich Drepper 2003-01-03 23:43:53 +00:00
parent f02392ec3c
commit 40e94df30a

View File

@ -1,6 +1,6 @@
/* Support macros for making weak and strong aliases for symbols, /* Support macros for making weak and strong aliases for symbols,
and for using symbol sets and linker warnings with GNU ld. and for using symbol sets and linker warnings with GNU ld.
Copyright (C) 1995-1998,2000,2001,2002 Free Software Foundation, Inc. Copyright (C) 1995-1998,2000,2001,2002,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -116,24 +116,8 @@
extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))); extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */ /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
# define weak_extern(symbol) _weak_extern (symbol) # define weak_extern(symbol) _weak_extern (weak symbol)
# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE # define _weak_extern(expr) _Pragma (#expr)
# ifdef HAVE_ASM_GLOBAL_DOT_NAME
# define _weak_extern(symbol) \
asm (".weakext " __SYMBOL_PREFIX #symbol "\n\t" \
".weakext ." __SYMBOL_PREFIX #symbol);
# else
# define _weak_extern(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol);
# endif
# else
# ifdef HAVE_ASM_GLOBAL_DOT_NAME
# define _weak_extern(symbol) \
asm (".weak " __SYMBOL_PREFIX #symbol "\n\t" \
".weak ." __SYMBOL_PREFIX #symbol);
# else
# define _weak_extern(symbol) asm (".weak " __SYMBOL_PREFIX #symbol);
# endif
# endif
# else # else