summaryrefslogtreecommitdiffstats
path: root/libpthread/nptl/compat
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/compat')
-rw-r--r--libpthread/nptl/compat/dl-sysdep.h35
-rw-r--r--libpthread/nptl/compat/libc-internal.h37
-rw-r--r--libpthread/nptl/compat/libc-symbols.h154
-rw-r--r--libpthread/nptl/compat/shlib-compat.h89
4 files changed, 315 insertions, 0 deletions
diff --git a/libpthread/nptl/compat/dl-sysdep.h b/libpthread/nptl/compat/dl-sysdep.h
new file mode 100644
index 000000000..c99fd3ea3
--- /dev/null
+++ b/libpthread/nptl/compat/dl-sysdep.h
@@ -0,0 +1,35 @@
+/* System-specific settings for dynamic linker code. Generic version.
+ Copyright (C) 2002, 2003, 2005 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* No multiple inclusion protection need here because it's just macros.
+ We don't want to use _DL_SYSDEP_H in case we are #include_next'd. */
+
+/* This macro must be defined to either 0 or 1.
+
+ If 1, then an errno global variable hidden in ld.so will work right with
+ all the errno-using libc code compiled for ld.so, and there is never a
+ need to share the errno location with libc. This is appropriate only if
+ all the libc functions that ld.so uses are called without PLT and always
+ get the versions linked into ld.so rather than the libc ones. */
+
+#ifdef IS_IN_rtld
+# define RTLD_PRIVATE_ERRNO 1
+#else
+# define RTLD_PRIVATE_ERRNO 0
+#endif
diff --git a/libpthread/nptl/compat/libc-internal.h b/libpthread/nptl/compat/libc-internal.h
new file mode 100644
index 000000000..e5fd5337a
--- /dev/null
+++ b/libpthread/nptl/compat/libc-internal.h
@@ -0,0 +1,37 @@
+/* This file contains a number of internal prototype declarations that
+ don't fit anywhere else. */
+
+#ifndef _LIBC_INTERNAL
+# define _LIBC_INTERNAL 1
+
+#include <hp-timing.h>
+
+/* Initialize the `__libc_enable_secure' flag. */
+extern void __libc_init_secure (void);
+
+/* This function will be called from _init in init-first.c. */
+extern void __libc_global_ctors (void);
+
+/* Discover the tick frequency of the machine if something goes wrong,
+ we return 0, an impossible hertz. */
+extern int __profile_frequency (void);
+libc_hidden_proto (__profile_frequency)
+
+/* Hooks for the instrumenting functions. */
+extern void __cyg_profile_func_enter (void *this_fn, void *call_site);
+extern void __cyg_profile_func_exit (void *this_fn, void *call_site);
+
+/* Get frequency of the system processor. */
+extern hp_timing_t __get_clockfreq (void);
+
+/* Free all allocated resources. */
+extern void __libc_freeres (void);
+libc_hidden_proto (__libc_freeres)
+
+/* Free resources stored in thread-local variables on thread exit. */
+extern void __libc_thread_freeres (void);
+
+/* Define and initialize `__progname' et. al. */
+extern void __init_misc (int, char **, char **);
+
+#endif /* _LIBC_INTERNAL */
diff --git a/libpthread/nptl/compat/libc-symbols.h b/libpthread/nptl/compat/libc-symbols.h
new file mode 100644
index 000000000..f2db6a416
--- /dev/null
+++ b/libpthread/nptl/compat/libc-symbols.h
@@ -0,0 +1,154 @@
+#ifndef _LIBC_SYMBOLS_H
+#define _LIBC_SYMBOLS_H 1
+
+/*
+ * NPTL - These definitions were taken from 'include/libc-symbols.h'
+ * in glibc. We are going to use the empty macros for now
+ * until we run into other compile errors that force us to
+ * do otherwise.
+ */
+#if 0
+# ifndef __ASSEMBLER__
+# if !defined HAVE_VISIBILITY_ATTRIBUTE \
+ || defined HAVE_BROKEN_VISIBILITY_ATTRIBUTE
+# define __hidden_proto_hiddenattr(attrs...)
+# else
+# define __hidden_proto_hiddenattr(attrs...) \
+ __attribute__ ((visibility ("hidden"), ##attrs))
+# endif
+# define hidden_proto(name, attrs...) \
+ __hidden_proto (name, __GI_##name, ##attrs)
+# define __hidden_proto(name, internal, attrs...) \
+ extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
+ __hidden_proto_hiddenattr (attrs);
+# define __hidden_asmname(name) \
+ __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
+# define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
+# define __hidden_asmname2(prefix, name) #prefix name
+# define __hidden_ver1(local, internal, name) \
+ extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
+ extern __typeof (name) __EI_##name \
+ __attribute__((alias (__hidden_asmname (#local))))
+# define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name);
+# define hidden_data_ver(local, name) hidden_ver(local, name)
+# define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
+# define hidden_data_def(name) hidden_def(name)
+# define hidden_weak(name) \
+ __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
+# define hidden_data_weak(name) hidden_weak(name)
+# else
+/* For assembly, we need to do the opposite of what we do in C:
+ in assembly gcc __REDIRECT stuff is not in place, so functions
+ are defined by its normal name and we need to create the
+ __GI_* alias to it, in C __REDIRECT causes the function definition
+ to use __GI_* name and we need to add alias to the real name.
+ There is no reason to use hidden_weak over hidden_def in assembly,
+ but we provide it for consistency with the C usage.
+ hidden_proto doesn't make sense for assembly but the equivalent
+ is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */
+# define hidden_def(name) strong_alias (name, __GI_##name)
+# define hidden_weak(name) hidden_def (name)
+# define hidden_ver(local, name) strong_alias (local, __GI_##name)
+# define hidden_data_def(name) strong_data_alias (name, __GI_##name)
+# define hidden_data_weak(name) hidden_data_def (name)
+# define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name)
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define HIDDEN_JUMPTARGET(name) .__GI_##name
+# else
+# define HIDDEN_JUMPTARGET(name) __GI_##name
+# endif
+# endif
+#else
+# ifndef __ASSEMBLER__
+# define hidden_proto(name, attrs...)
+# else
+# define HIDDEN_JUMPTARGET(name) JUMPTARGET(name)
+# endif /* Not __ASSEMBLER__ */
+# define hidden_weak(name)
+# define hidden_def(name)
+# define hidden_ver(local, name)
+# define hidden_data_weak(name)
+# define hidden_data_def(name)
+# define hidden_data_ver(local, name)
+#endif
+
+#if defined NOT_IN_libc && defined IS_IN_rtld
+# define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define rtld_hidden_def(name) hidden_def (name)
+# define rtld_hidden_weak(name) hidden_weak (name)
+# define rtld_hidden_ver(local, name) hidden_ver (local, name)
+# define rtld_hidden_data_def(name) hidden_data_def (name)
+# define rtld_hidden_data_weak(name) hidden_data_weak (name)
+# define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define rtld_hidden_proto(name, attrs...)
+# define rtld_hidden_def(name)
+# define rtld_hidden_weak(name)
+# define rtld_hidden_ver(local, name)
+# define rtld_hidden_data_def(name)
+# define rtld_hidden_data_weak(name)
+# define rtld_hidden_data_ver(local, name)
+#endif
+
+#if !defined NOT_IN_libc
+# define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libc_hidden_def(name) hidden_def (name)
+# define libc_hidden_weak(name) hidden_weak (name)
+# define libc_hidden_ver(local, name) hidden_ver (local, name)
+# define libc_hidden_data_def(name) hidden_data_def (name)
+# define libc_hidden_data_weak(name) hidden_data_weak (name)
+# define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libc_hidden_proto(name, attrs...)
+# define libc_hidden_def(name)
+# define libc_hidden_weak(name)
+# define libc_hidden_ver(local, name)
+# define libc_hidden_data_def(name)
+# define libc_hidden_data_weak(name)
+# define libc_hidden_data_ver(local, name)
+#endif
+
+#ifdef HAVE_TLS_MODEL_ATTRIBUTE
+# define attribute_tls_model_ie __attribute__ ((tls_model ("initial-exec")))
+#else
+# define attribute_tls_model_ie
+#endif
+
+#ifdef HAVE_Z_RELRO
+# define attribute_relro __attribute__ ((section (".data.rel.ro")))
+#else
+# define attribute_relro
+#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.
+ In a shared library, this is always local to that shared object.
+ For static linking, the set might be wholly absent and so we use
+ weak references. */
+# define symbol_set_declare(set) \
+ extern char const __start_##set[] __symbol_set_attribute; \
+ extern char const __stop_##set[] __symbol_set_attribute;
+
+# define __symbol_set_attribute attribute_hidden
+
+/* Return a pointer (void *const *) to the first element of SET. */
+# define symbol_set_first_element(set) ((void *const *) (&__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) >= (void *const *) &__stop_##set)
+
+/* Not compiling ELF shared libraries at all, so never any old versions. */
+# define SHLIB_COMPAT(lib, introduced, obsoleted) 0
+
+/* No versions to worry about, just make this the global definition. */
+# define versioned_symbol(lib, local, symbol, version) \
+ weak_alias (local, symbol)
+
+/* This should not appear outside `#if SHLIB_COMPAT (...)'. */
+# define compat_symbol(lib, local, symbol, version) ...
+
+#endif /* _LIBC_SYMBOLS_H */
diff --git a/libpthread/nptl/compat/shlib-compat.h b/libpthread/nptl/compat/shlib-compat.h
new file mode 100644
index 000000000..1e6d1782d
--- /dev/null
+++ b/libpthread/nptl/compat/shlib-compat.h
@@ -0,0 +1,89 @@
+/* Macros for managing ABI-compatibility definitions using ELF symbol versions.
+ Copyright (C) 2000, 2002 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SHLIB_COMPAT_H
+#define _SHLIB_COMPAT_H 1
+
+#if defined HAVE_ELF && defined DO_VERSIONING
+/* Since there is just one set of .d files generated, we need to
+ include this unconditionally to have the dependency noticed properly. */
+#include <abi-versions.h> /* header generated by abi-versions.awk */
+#endif
+
+#if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
+
+/* The file abi-versions.h (generated by scripts/abi-versions.awk) defines
+ symbols like `ABI_libm_GLIBC_2_0' for each version set in the source
+ code for each library. For a version set that is subsumed by a later
+ version set, the definition gives the subsuming set, i.e. if GLIBC_2_0
+ is subsumed by GLIBC_2_1, then ABI_libm_GLIBC_2_0 == ABI_libm_GLIBC_2_1.
+ Each version set that is to be distinctly defined in the output has an
+ unique positive integer value, increasing with newer versions. Thus,
+ evaluating two ABI_* symbols reduces to integer values that differ only
+ when the two version sets named are in fact two different ABIs we are
+ supporting. If these do not differ, then there is no need to compile in
+ extra code to support this version set where it has been superseded by a
+ newer version. The compatibility code should be conditionalized with
+ e.g. `#if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_2)' for code introduced
+ in the GLIBC_2.0 version and obsoleted in the GLIBC_2.2 version. */
+
+# define SHLIB_COMPAT(lib, introduced, obsoleted) \
+ ((IS_IN_##lib - 0) \
+ && (!(ABI_##lib##_##obsoleted - 0) \
+ || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0))))
+
+# ifndef NOT_IN_libc
+# define IS_IN_libc 1
+# endif
+
+/* That header also defines symbols like `VERSION_libm_GLIBC_2_1' to
+ the version set name to use for e.g. symbols first introduced into
+ libm in the GLIBC_2.1 version. Definitions of symbols with explicit
+ versions should look like:
+ versioned_symbol (libm, new_foo, foo, GLIBC_2_1);
+ This will define the symbol `foo' with the appropriate default version,
+ i.e. either GLIBC_2.1 or the "earliest version" specified in
+ shlib-versions if that is newer. */
+
+# define versioned_symbol(lib, local, symbol, version) \
+ versioned_symbol_1 (local, symbol, VERSION_##lib##_##version)
+# define versioned_symbol_1(local, symbol, name) \
+ default_symbol_version (local, symbol, name)
+
+# define compat_symbol(lib, local, symbol, version) \
+ compat_symbol_1 (local, symbol, VERSION_##lib##_##version)
+# define compat_symbol_1(local, symbol, name) \
+ symbol_version (local, symbol, name)
+
+#else
+
+/* Not compiling ELF shared libraries at all, so never any old versions. */
+# define SHLIB_COMPAT(lib, introduced, obsoleted) 0
+
+/* No versions to worry about, just make this the global definition. */
+# define versioned_symbol(lib, local, symbol, version) \
+ weak_alias (local, symbol)
+
+/* This should not appear outside `#if SHLIB_COMPAT (...)'. */
+# define compat_symbol(lib, local, symbol, version) ...
+
+#endif
+
+
+#endif /* shlib-compat.h */