summaryrefslogtreecommitdiff
path: root/libc/include/libc-symbols.h
diff options
context:
space:
mode:
authormaxim <maxim@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-06-26 11:00:47 +0000
committermaxim <maxim@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-06-26 11:00:47 +0000
commitf9f7cb825fff4924ec283efd84ecb0a6977fb0af (patch)
tree462660f11c5c94f0681c331b099a3743a6ae88e3 /libc/include/libc-symbols.h
parent005f335b4d902ebdf18187d713d58260ddc124e0 (diff)
Make --disable-versioning work.
* scripts/versions.awk (versioning): New parameter, don't output version information if it is defined to 'no'. * include/shlib-compat.h (IS_IN_libc, versioned_symbol), (versioned_symbol_1): Define when !DO_VERSIONING. (invisible_compat_symbol): Define, instead of compat_symbol when appropriate. * include/libc-symbols.h (default_symbol_version): Define when !DO_VERSIONING. (versioned_weak): Define. * Makerules: Generate version maps when !DO_VERSIONING to properly set symbol binding. (abi_versions_file): Define, use instead of abi-versions.h. (libc_gcclibs): Define, link against libgcc_eh when !DO_VERSIONING. * extra-lib.mk, elf/Makefile: Update, handle --disable-versioning. * elf/do-rel.h: Handle !DO_VERSIONING. * sysdeps/powerpc/powerpc32/dl-machine.c: Don't error when !DO_VERSIONING. * sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h: Define stuff when !DO_VERSIONING. * nptl/pthread_kill_other_threads.c (compat_symbol): Surround with ifdef DO_VERSIONING. * sysdeps/wordsize-32/divdi3.c: Use invisible_compat_symbol. * nptl/Makefile (tst-_res1): Disable test when !DO_VERSIONING. * sysdeps/powerpc/longjmp.c (_longjmp, longjmp, siglongjmp): Update. * sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h (ldbl_weak_alias): Update. * sysdeps/ieee754/ldbl-128ibm/s_isinfl.c (__isinfl): Update. * sysdeps/ieee754/ldbl-128ibm/s_finitel.c (finitel): Update. * sysdeps/ieee754/ldbl-128ibm/s_isnanl.c (__isnanl): Update. * sysdeps/ieee754/ldbl-128ibm/strtold_l.c (wcstold_l, strtold_l): Update. git-svn-id: svn://svn.eglibc.org/trunk@8608 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/include/libc-symbols.h')
-rw-r--r--libc/include/libc-symbols.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/libc/include/libc-symbols.h b/libc/include/libc-symbols.h
index 68da77c58..76876ac36 100644
--- a/libc/include/libc-symbols.h
+++ b/libc/include/libc-symbols.h
@@ -447,10 +447,31 @@ for linking")
__asm__ (".symver " #real "," #name "@@" #version)
# endif
# endif
-#else
+# define versioned_weak /* nothing */
+#else /* !DO_VERSIONING */
+
# define symbol_version(real, name, version)
-# define default_symbol_version(real, name, version) \
- strong_alias(real, name)
+# ifdef __ASSEMBLER__
+# define default_symbol_version(real, name, version) \
+ strong_alias (real, name)
+# else
+/* We can't use simple strong_alias in C here due to
+ symbols defined with hidden_def and company.
+ As you see above, symbol versions are output in plain assembly,
+ so, to archieve the same effect, we use __asm__ (#name).
+
+ Define an alias to REAL with C name __FI_##NAME and
+ asm name NAME. We use __FI_* namespace to fill a gap
+ between __EI_* and __GI_* namespaces. */
+# define default_symbol_version(real, name, version) \
+ extern __typeof (real) __FI_##name __asm__ (#name); \
+ extern __typeof (real) __FI_##name __attribute__((alias (#real)))
+# endif
+/* When not using symbol versioning we use an equivalent of
+ strong_alias to define a symbol; hence add __attribute__((weak))
+ to make it weak instead. When using .symver, this is not necessary
+ as .symver handles weakness properly. */
+# define versioned_weak __attribute__((weak))
#endif
#if defined SHARED || defined LIBC_NONSHARED
@@ -561,7 +582,7 @@ for linking")
versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
libc_hidden_ver (__real_foo, foo) */
-#if defined SHARED && defined DO_VERSIONING && !defined NO_HIDDEN
+#if defined SHARED && !defined NO_HIDDEN
# ifndef __ASSEMBLER__
# define __hidden_proto_hiddenattr(attrs...) \
__attribute__ ((visibility ("hidden"), ##attrs))