mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 04:50:07 +00:00
da2d1bc5ad
1998-02-10 23:57 Ulrich Drepper <drepper@happy.cygnus.com> * misc/tst-efgcvt.c: Add more tests. * misc/efgcvt_r.c: Correct result for above new tests. 1998-02-06 17:22 H.J. Lu <hjl@gnu.org> * misc/efgcvt_r.c (fcvt_r, ecvt_r): Correctly handle NDIGIT <= 0. 1998-02-10 16:48 Philip Blundell <pb@nexus.co.uk> * Makerules (install-no-libc.a-nosubdir): Don't install-bin (etc) if the programs weren't built. 1998-02-09 10:12 Philip Blundell <pb@nexus.co.uk> * sysdeps/libm-ieee754/s_exp2.c (__ieee754_exp2): If we don't have FE_TONEAREST, soldier on regardless and do the best we can. * sysdeps/libm-ieee754/s_exp2f.c (__ieee754_exp2f): likewise. 1998-02-5 17:20 Philip Blundell <pb@nexus.co.uk> * sysdeps/standalone/filedesc.h: Define __need_FOPEN_MAX, not _STDIO_H, before including <bits/stdio_lim.h>. * sysdeps/standalone/arm/bits/errno.h (EOVERFLOW): Added. * io/fts.c (fts_build): Don't try to use d_type if it doesn't exist. * sysdeps/arm/sys/ucontext.h: New file. 1998-02-04 10:11 Philip Blundell <pb@nexus.co.uk> * manual/stdio.texi (Formatted Output Functions): Explicitly say that the return value from snprintf() does not count the terminating NUL as a character. 1998-02-10 16:57 Ulrich Drepper <drepper@happy.cygnus.com> * manual/users.texi: Rewrite to describe correct POSIX behaviour, add description for sete[ug]id and general cleanup. Patch by Zack Weinberg <zack@rabi.phys.columbia.edu>. 1998-01-04 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makefile (parent-clean): Don't remove makefile fragments here. (postclean): New variable. (clean): Remove makefile fragments here. (realclean distclean): Likewise. Pass sysdep-subdirs to sub-make. (generated): Add isomac and isomanc.out. * Makeconfig ($(common-objpfx)soversions.mk): Don't generate if avoid-generated is set. (postclean-generated): Add soversion.mk. ($(common-objpfx)version.mk): Don't include if avoid-generated is set. * Makerules: Still need to include $(+sysdir_pfx)sysd-Makefile if avoid-generated is set. (common-generated): Add libc.so and libc.so$(libc.so-version). (generated): Add versioned libraries. (common-mostlyclean): Also remove %.so and %_pic.a. * csu/Makefile (generated): Add abi-tag.h. * db2/Makefile (extra-objs): Add getlong.o. * elf/Makefile (generated): Add ld.so, ldd and $(rtld-installed-name). (others): Add ldconfig here instead of ldconfig.o to extra-objs. * malloc/Makefile (generated): Add mtrace. * po/Makefile: Don't include version.mk, not needed any more. * sunrpc/Makefile (generated): Add rpc-proto.d and rpcgen. * sysdeps/unix/Makefile: Fix local_lim.h -> bits/local_lim.h, syscall.h -> sys/syscall.h. (common-generated): Add s-proto.d. (postclean-generated): Add sysd-syscalls. * localedata/Makefile (test-output): Add all output files. (generated): Add test-input and test-output. (generated-dirs): Add all the dirs. 1998-01-04 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makefile (test-output, generated, generated-dirs): New variables. 1998-02-10 16:57 Ulrich Drepper <drepper@happy.cygnus.com> * resolv/nss_dns/dns-host.c: Various code cleanups. 1998-02-09 08:10 H.J. Lu <hjl@gnu.org> * resolv/gethnamaddr.c (getanswer): Fix the PTR/CNAME bug. From Philip Blundell <pb@nexus.co.uk>. * resolv/nss_dns/dns-host.c (getanswer_r): Ditto. 1998-02-08 Andreas Jaeger <aj@arthur.rhein-neckar.de> * libc.map: Add .rem, .div, .mul, .udiv, .umul, .urem for Sparc. Suggested by debian/sparc porters. 1998-02-07 Andreas Jaeger <aj@arthur.rhein-neckar.de> * misc/tst-efgcvt.c: Totally rewritten, added a lot of new tests for ecvt and fcvt. 1998-02-10 16:32 Ulrich Drepper <drepper@happy.cygnus.com> * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): Use __xstat and __fxstat instead of stat and fstat. Use namespace clean __stpcpy. * signal/signal.h: Always define sigset_t if __need_sigset_t is defined even if __USE_POSIX is not defined. 1998-02-02 20:51 Zack Weinberg <zack@rabi.phys.columbia.edu> * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): Correct last patch to support obsolete tty major numbers correctly. 1998-02-02 08:47 H.J. Lu <hjl@gnu.org> * login/Makefile ($(inst_libexecdir)/pt_chown): Make the target directory first and ignore install error. * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): Substract 128 from ptyno and fix a typo for the BSD style pty. 1998-02-01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/Makefile ($(common-objpfx)s-proto.d): Depend on all syscalls.list's. 1998-02-01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add getresuid and getresgid. * sysdeps/unix/sysv/linux/getresuid.c: New file. * sysdeps/unix/sysv/linux/getresgid.c: New file. * sysdeps/unix/sysv/linux/syscalls.list: Remove getres[ug]id, add s_getres[ug]id. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Add getres[ug]id. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/powerpc/syscalls.list: Likewise. 1998-02-02 08:11 H.J. Lu <hjl@gnu.org> * nscd/grpcache.c: Include <stdlib.h>. 1998-02-01 16:01 H.J. Lu <hjl@gnu.org> * stdlib/atoll.c: Fix comments. * sysdeps/posix/ttyname.c: Ignore stdin/stdout/stderr. * sysdeps/posix/ttyname_r.c: Ditto. 1998-02-03 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * io/sys/stat.h: Define S_IFLNK and S_IFSOCK if __USE_BSD or __USE_MISC, independent of __USE_UNIX98. 1998-02-10 19:18 Ulrich Drepper <drepper@happy.cygnus.com> * sysdeps/unix/sysv/linux/i386/sigaction.c (__libc_missing_rt_sigs): Rename from __libc_have_rt_sigs and leave as COMMON data. 1998-02-04 11:58 Richard Henderson <rth@twiddle.rth.home> * Makeconfig (CFLAGS-.os): Kill -fno-common. * Makerules (libc.so): Prelink libc_pic.a, allocating commons. * libc.map (GLIBC_2.1): Add Linux/Alpha tv64 symbols. * elf/rtld.map: New file. Needed to define the GLIBC_2.* version symbols. * include/libc-symbols.h (symbol_version, default_symbol_version): Provide asm versions and correct !DO_VERSIONING versions. * sysdeps/unix/make-syscalls.sh: Recognize version symbols in the weak symbol list. * sysdeps/unix/sysv/linux/sigaction.c (__libc_missing_rt_sigs): Rename from __libc_have_rt_sigs and leave as COMMON data. * sysdeps/unix/sysv/linux/sigpending.c: Likewise. * sysdeps/unix/sysv/linux/sigprocmask.c: Likewise. * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise. 1998-02-04 16:41 Zack Weinberg <zack@rabi.phys.columbia.edu> * sunrpc/Makefile: Correct dependencies of rpcgen. 1998-02-10 03:00 Ulrich Drepper <drepper@happy.cygnus.com> * nscd/Makefile: Fix test for available linuxthreads add-on. Patch by Zack Weinberg <zack@rabi.phys.columbia.edu>. 1998-02-05 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/unix/sysv/linux/syscalls.list: Fix typo in lchown. 1998-02-03 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/gnu/Makefile: Respect with-cvs variable. * manual/errno.texi (Error Messages): Correct description of strerror_r. Pointed out by jonas@bagge.se. 1998-01-29 Andreas Jaeger <aj@arthur.rhein-neckar.de> * manual/socket.texi (Host Address Functions): Clarify description of inet_network. 1998-02-07 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/grantpt.c (argv): Move const to toplevel. (grantpt): Delete superfluous cast. 1998-02-06 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makefile ($(inst_slibdir)/libc-$(version).so): Depend on elf/ldso_install instead of elf/subdir_install. (elf/ldso_install): New target. * elf/Makefile (ldso_install): New target. 1998-02-07 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/powerpc/socket.S: Really do the change of 1998-01-06. 1998-02-07 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strcmp): Use __string2_1bptr_p only for constant expressions. 1998-02-07 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * nss/test-netdb.c: Include <unistd.h> for gethostname and "nss.h" for __nss_configure_lookup. (output_hostent): Remove unused variable. 1998-02-07 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/tst-inlcall.c: Fix format string. 1998-02-09 Andreas Jaeger <aj@arthur.rhein-neckar.de> * inet/netinet/in.h: Rename second parameter of bindresvport to avoid buggy gcc warning. [PR libc/412]
347 lines
12 KiB
C
347 lines
12 KiB
C
/* Support macros for making weak and strong aliases for symbols,
|
||
and for using symbol sets and linker warnings with GNU ld.
|
||
Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||
This file is part of the GNU C Library.
|
||
|
||
The GNU C Library is free software; you can redistribute it and/or
|
||
modify it under the terms of the GNU Library General Public License as
|
||
published by the Free Software Foundation; either version 2 of the
|
||
License, or (at your option) any later version.
|
||
|
||
The GNU C Library is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
Library General Public License for more details.
|
||
|
||
You should have received a copy of the GNU Library General Public
|
||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||
Boston, MA 02111-1307, USA. */
|
||
|
||
#ifndef _LIBC_SYMBOLS_H
|
||
#define _LIBC_SYMBOLS_H 1
|
||
|
||
/* This file's macros are included implicitly in the compilation of every
|
||
file in the C library by -imacros.
|
||
|
||
We include config.h which is generated by configure.
|
||
It should define for us the following symbols:
|
||
|
||
* HAVE_ASM_SET_DIRECTIVE if we have `.set B, A' instead of `A = B'.
|
||
* ASM_GLOBAL_DIRECTIVE with `.globl' or `.global'.
|
||
* HAVE_GNU_LD if using GNU ld, with support for weak symbols in a.out,
|
||
and for symbol set and warning messages extensions in a.out and ELF.
|
||
* HAVE_ELF if using ELF, which supports weak symbols using `.weak'.
|
||
* HAVE_ASM_WEAK_DIRECTIVE if we have weak symbols using `.weak'.
|
||
* HAVE_ASM_WEAKEXT_DIRECTIVE if we have weak symbols using `.weakext'.
|
||
|
||
*/
|
||
|
||
/* This is defined for the compilation of all C library code. features.h
|
||
tests this to avoid inclusion of stubs.h while compiling the library,
|
||
before stubs.h has been generated. Some library code that is shared
|
||
with other packages also tests this symbol to see if it is being
|
||
compiled as part of the C library. We must define this before including
|
||
config.h, because it makes some definitions conditional on whether libc
|
||
itself is being compiled, or just some generator program. */
|
||
#define _LIBC 1
|
||
|
||
/* Enable declarations of GNU extensions, since we are compiling them. */
|
||
#define _GNU_SOURCE 1
|
||
/* And we also need the data for the reentrant functions. */
|
||
#define _REENTRANT 1
|
||
|
||
#include <config.h>
|
||
/*
|
||
|
||
*/
|
||
|
||
#ifndef ASSEMBLER
|
||
|
||
/* Define the macros `_' and `N_' for conveniently marking translatable
|
||
strings in the libc source code. */
|
||
|
||
# define N_(msgid) msgid
|
||
|
||
# include <libintl.h>
|
||
extern const char _libc_intl_domainname[];
|
||
|
||
# ifdef dgettext
|
||
/* This is defined as an optimizing macro, so use it. */
|
||
# define _(msgid) dgettext (_libc_intl_domainname, (msgid))
|
||
# else
|
||
/* Be sure to use only the __ name when `dgettext' is a plain function
|
||
instead of an optimizing macro. */
|
||
# define _(msgid) __dgettext (_libc_intl_domainname, (msgid))
|
||
# endif
|
||
|
||
#endif
|
||
|
||
/*
|
||
|
||
*/
|
||
/* The symbols in all the user (non-_) macros are C symbols.
|
||
HAVE_GNU_LD without HAVE_ELF implies a.out. */
|
||
|
||
#if defined HAVE_ASM_WEAK_DIRECTIVE || defined HAVE_ASM_WEAKEXT_DIRECTIVE
|
||
# define HAVE_WEAK_SYMBOLS
|
||
#endif
|
||
|
||
#ifndef __SYMBOL_PREFIX
|
||
# ifdef NO_UNDERSCORES
|
||
# define __SYMBOL_PREFIX
|
||
# else
|
||
# define __SYMBOL_PREFIX "_"
|
||
# endif
|
||
#endif
|
||
|
||
#ifndef C_SYMBOL_NAME
|
||
# ifdef NO_UNDERSCORES
|
||
# define C_SYMBOL_NAME(name) name
|
||
# else
|
||
# define C_SYMBOL_NAME(name) _##name
|
||
# endif
|
||
#endif
|
||
|
||
|
||
/* Define ALIAS as a strong alias for ORIGINAL. */
|
||
#ifdef HAVE_ASM_SET_DIRECTIVE
|
||
# define strong_alias_asm(original, alias) \
|
||
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias); \
|
||
.set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
|
||
# ifdef ASSEMBLER
|
||
# define strong_alias(original, alias) strong_alias_asm (original, alias)
|
||
# else
|
||
# define strong_alias(original, alias) \
|
||
asm (__string_1 (ASM_GLOBAL_DIRECTIVE) " " __SYMBOL_PREFIX #alias "\n" \
|
||
".set " __SYMBOL_PREFIX #alias "," __SYMBOL_PREFIX #original);
|
||
# endif
|
||
#else
|
||
# define strong_alias_asm(original, alias) \
|
||
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias); \
|
||
C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
|
||
# ifdef ASSEMBLER
|
||
# define strong_alias(original, alias) strong_alias_asm (original, alias)
|
||
# else
|
||
# define strong_alias(original, alias) \
|
||
asm (__string_1 (ASM_GLOBAL_DIRECTIVE) " " __SYMBOL_PREFIX #alias "\n" \
|
||
__SYMBOL_PREFIX #alias " = " __SYMBOL_PREFIX #original);
|
||
# endif
|
||
#endif
|
||
|
||
/* Helper macros used above. */
|
||
#define __string_1(x) __string_0(x)
|
||
#define __string_0(x) #x
|
||
|
||
|
||
#ifdef HAVE_WEAK_SYMBOLS
|
||
|
||
# ifdef ASSEMBLER
|
||
|
||
# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
|
||
|
||
/* Define ALIAS as a weak alias for ORIGINAL.
|
||
If weak aliases are not available, this defines a strong alias. */
|
||
# define weak_alias(original, alias) \
|
||
.weakext C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
|
||
|
||
/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
|
||
# define weak_extern(symbol) \
|
||
.weakext C_SYMBOL_NAME (symbol)
|
||
|
||
# else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||
|
||
/* Define ALIAS as a weak alias for ORIGINAL.
|
||
If weak aliases are not available, this defines a strong alias. */
|
||
# define weak_alias(original, alias) \
|
||
.weak C_SYMBOL_NAME (alias); \
|
||
C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
|
||
|
||
|
||
/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
|
||
# define weak_extern(symbol) \
|
||
.weak C_SYMBOL_NAME (symbol)
|
||
|
||
# endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||
|
||
# else /* ! ASSEMBLER */
|
||
|
||
# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE
|
||
# define weak_extern_asm(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol);
|
||
# define weak_alias_asm(original, alias) \
|
||
asm (".weakext " __SYMBOL_PREFIX #alias ", " __SYMBOL_PREFIX #original);
|
||
# else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||
# define weak_extern_asm(symbol) asm (".weak " __SYMBOL_PREFIX #symbol);
|
||
# define weak_alias_asm(original, alias) \
|
||
asm (".weak " __SYMBOL_PREFIX #alias "\n" \
|
||
__SYMBOL_PREFIX #alias " = " __SYMBOL_PREFIX #original);
|
||
# endif /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
|
||
|
||
# define weak_alias(o, a) weak_alias_asm (o, a)
|
||
# define weak_extern(symbol) weak_extern_asm (symbol)
|
||
|
||
# endif /* ! ASSEMBLER */
|
||
#else
|
||
# define weak_alias(original, alias) strong_alias(original, alias)
|
||
# define weak_extern(symbol) /* Do nothing; the ref will be strong. */
|
||
#endif
|
||
|
||
|
||
#if (!defined ASSEMBLER && \
|
||
(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)))
|
||
/* GCC 2.7 and later has special syntax for weak symbols and aliases.
|
||
Using that is better when possible, because the compiler and assembler
|
||
are better clued in to what we are doing. */
|
||
# undef strong_alias
|
||
# define strong_alias(name, aliasname) \
|
||
extern __typeof (name) aliasname __attribute__ ((alias (#name)));
|
||
|
||
# ifdef HAVE_WEAK_SYMBOLS
|
||
# undef weak_alias
|
||
# define weak_alias(name, aliasname) \
|
||
extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
|
||
|
||
/* This comes between the return type and function name in
|
||
a function definition to make that definition weak. */
|
||
# define weak_function __attribute__ ((weak))
|
||
# define weak_const_function __attribute__ ((weak, __const__))
|
||
|
||
# endif /* HAVE_WEAK_SYMBOLS. */
|
||
#endif /* Not ASSEMBLER, and GCC 2.7 or later. */
|
||
|
||
|
||
#ifndef weak_function
|
||
/* If we do not have the __attribute__ ((weak)) syntax, there is no way we
|
||
can define functions as weak symbols. The compiler will emit a `.globl'
|
||
directive for the function symbol, and a `.weak' directive in addition
|
||
will produce an error from the assembler. */
|
||
# define weak_function /* empty */
|
||
# define weak_const_function /* empty */
|
||
#endif
|
||
|
||
/* On some platforms we can make internal function calls (i.e., calls of
|
||
functions not exported) a bit faster by using a different calling
|
||
convention. */
|
||
#ifndef internal_function
|
||
# define internal_function /* empty */
|
||
#endif
|
||
|
||
/* When a reference to SYMBOL is encountered, the linker will emit a
|
||
warning message MSG. */
|
||
#ifdef HAVE_GNU_LD
|
||
# ifdef HAVE_ELF
|
||
|
||
/* We want the .gnu.warning.SYMBOL section to be unallocated. */
|
||
# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
|
||
# define __make_section_unallocated(section_string) \
|
||
asm(".section " section_string "; .previous");
|
||
# elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
|
||
# define __make_section_unallocated(section_string) \
|
||
asm(".pushsection " section_string "; .popsection");
|
||
# else
|
||
# define __make_section_unallocated(section_string)
|
||
# endif
|
||
|
||
# define link_warning(symbol, msg) \
|
||
__make_section_unallocated (".gnu.warning." #symbol) \
|
||
static const char __evoke_link_warning_##symbol[] \
|
||
__attribute__ ((section (".gnu.warning." #symbol))) = msg;
|
||
# else
|
||
# define link_warning(symbol, msg) \
|
||
asm(".stabs \"" msg "\",30,0,0,0\n" \
|
||
".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
|
||
# endif
|
||
#else
|
||
/* We will never be heard; they will all die horribly. */
|
||
# define link_warning(symbol, msg)
|
||
#endif
|
||
|
||
/* A canned warning for sysdeps/stub functions. */
|
||
#define stub_warning(name) \
|
||
link_warning (name, \
|
||
"warning: " #name " is not implemented and will always fail")
|
||
|
||
/*
|
||
|
||
*/
|
||
|
||
#ifdef HAVE_GNU_LD
|
||
|
||
/* Symbol set support macros. */
|
||
|
||
# ifdef HAVE_ELF
|
||
|
||
/* Make SYMBOL, which is in the text segment, an element of SET. */
|
||
# define text_set_element(set, symbol) _elf_set_element(set, symbol)
|
||
/* Make SYMBOL, which is in the data segment, an element of SET. */
|
||
# define data_set_element(set, symbol) _elf_set_element(set, symbol)
|
||
/* Make SYMBOL, which is in the bss segment, an element of SET. */
|
||
# define bss_set_element(set, symbol) _elf_set_element(set, symbol)
|
||
|
||
/* These are all done the same way in ELF.
|
||
There is a new section created for each set. */
|
||
# ifdef PIC
|
||
/* When building a shared library, make the set section writable,
|
||
because it will need to be relocated at run time anyway. */
|
||
# define _elf_set_element(set, symbol) \
|
||
static const void *__elf_set_##set##_element_##symbol##__ \
|
||
__attribute__ ((unused, section (#set))) = &(symbol)
|
||
# else
|
||
# define _elf_set_element(set, symbol) \
|
||
static const void *const __elf_set_##set##_element_##symbol##__ \
|
||
__attribute__ ((unused, section (#set))) = &(symbol)
|
||
# endif
|
||
|
||
/* Define SET as a symbol set. This may be required (it is in a.out) to
|
||
be able to use the set's contents. */
|
||
# define symbol_set_define(set) symbol_set_declare(set)
|
||
|
||
/* Declare SET for use in this module, if defined in another module. */
|
||
# define symbol_set_declare(set) \
|
||
extern void *const __start_##set __attribute__ ((__weak__)); \
|
||
extern void *const __stop_##set __attribute__ ((__weak__)); \
|
||
weak_extern (__start_##set) weak_extern (__stop_##set)
|
||
|
||
/* Return a pointer (void *const *) to the first element of SET. */
|
||
# define symbol_set_first_element(set) (&__start_##set)
|
||
|
||
/* Return true iff PTR (a void *const *) has been incremented
|
||
past the last element in SET. */
|
||
# define symbol_set_end_p(set, ptr) ((ptr) >= &__stop_##set)
|
||
|
||
# else /* Not ELF: a.out. */
|
||
|
||
# define text_set_element(set, symbol) \
|
||
asm(".stabs \"" __SYMBOL_PREFIX #set "\",23,0,0," __SYMBOL_PREFIX #symbol)
|
||
# define data_set_element(set, symbol) \
|
||
asm(".stabs \"" __SYMBOL_PREFIX #set "\",25,0,0," __SYMBOL_PREFIX #symbol)
|
||
# define bss_set_element(set, symbol) ?error Must use initialized data.
|
||
# define symbol_set_define(set) void *const (set)[1];
|
||
# define symbol_set_declare(set) extern void *const (set)[1];
|
||
|
||
# define symbol_set_first_element(set) &(set)[1]
|
||
# define symbol_set_end_p(set, ptr) (*(ptr) == 0)
|
||
|
||
# endif /* ELF. */
|
||
#endif /* Have GNU ld. */
|
||
|
||
#if DO_VERSIONING
|
||
# ifdef ASSEMBLER
|
||
# define symbol_version(real, name, version) \
|
||
.symver real, name##@##version
|
||
# define default_symbol_version(real, name, version) \
|
||
.symver real, name##@##@##version
|
||
# else
|
||
# define symbol_version(real, name, version) \
|
||
__asm__ (".symver " #real "," #name "@" #version)
|
||
# define default_symbol_version(real, name, version) \
|
||
__asm__ (".symver " #real "," #name "@@" #version)
|
||
# endif
|
||
#else
|
||
# define symbol_version(real, name, version)
|
||
# define default_symbol_version(real, name, version) \
|
||
strong_alias(real, name)
|
||
#endif
|
||
|
||
#endif /* libc-symbols.h */
|