summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/elf.h2
-rw-r--r--include/errno.h2
-rw-r--r--include/fcntl.h4
-rw-r--r--include/libc-symbols.h79
-rw-r--r--include/tls.h2
-rw-r--r--include/unistd.h2
6 files changed, 72 insertions, 19 deletions
diff --git a/include/elf.h b/include/elf.h
index 19805d7c9..eb298292f 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -431,6 +431,7 @@ typedef struct
#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */
#define SHT_NUM 19 /* Number of defined types. */
#define SHT_LOOS 0x60000000 /* Start OS-specific */
+#define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */
#define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */
#define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */
#define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */
@@ -813,6 +814,7 @@ typedef struct
If any adjustment is made to the ELF object after it has been
built these entries will need to be adjusted. */
#define DT_ADDRRNGLO 0x6ffffe00
+#define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table. */
#define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */
#define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */
#define DT_CONFIG 0x6ffffefa /* Configuration information. */
diff --git a/include/errno.h b/include/errno.h
index 91d78df95..2ad8e197f 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -70,7 +70,9 @@ extern __thread int errno attribute_tls_model_ie;
# endif
#endif
+#ifndef __set_errno
#define __set_errno(val) (errno = (val))
+#endif
#ifndef __ASSEMBLER__
extern int *__errno_location (void) __THROW __attribute__ ((__const__));
diff --git a/include/fcntl.h b/include/fcntl.h
index e0fec67be..54513ddb0 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -75,6 +75,10 @@ extern int fcntl (int __fd, int __cmd, ...);
extern int __fcntl_nocancel (int fd, int cmd, ...);
#endif
+#ifdef __USE_LARGEFILE64
+extern int fcntl64 (int __fd, int __cmd, ...);
+#endif
+
/* Open FILE and return a new file descriptor for it, or -1 on error.
OFLAG determines the type of access used. If O_CREAT is on OFLAG,
the third argument is taken as a `mode_t', the mode of the created file.
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index bdc9ee23d..6e9c5c9f0 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -233,6 +233,19 @@
# else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
+# ifdef HAVE_ASM_SET_DIRECTIVE
+# ifdef HAVE_ASM_GLOBAL_DOT_NAME
+# define weak_alias(original, alias) \
+ .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original) ASM_LINE_SEP \
+ .weak C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_DOT_NAME (alias), C_SYMBOL_DOT_NAME (original)
+# else
+# define weak_alias(original, alias) \
+ .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias), C_SYMBOL_NAME (original)
+# endif
+# else /* ! HAVE_ASM_SET_DIRECTIVE */
# ifdef HAVE_ASM_GLOBAL_DOT_NAME
# define weak_alias(original, alias) \
.weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
@@ -244,7 +257,7 @@
.weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
# endif
-
+# endif
# define weak_extern(symbol) \
.weak C_SYMBOL_NAME (symbol)
@@ -412,31 +425,63 @@
#if !defined STATIC && !defined __BCC__
# ifndef __ASSEMBLER__
-# define hidden_proto(name, attrs...)
-# define hidden_def(name)
-# define hidden_data_def(name)
-# define hidden_weak(name)
-# define hidden_data_weak(name)
+# 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_asmname1 (,#local))))
+# 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 /* __ASSEMBLER__ */
# ifdef HAVE_ASM_SET_DIRECTIVE
# ifdef HAVE_ASM_GLOBAL_DOT_NAME
-# define _hidden_strong_alias(original, alias)
+# define _hidden_strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original) ASM_LINE_SEP \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_DOT_NAME (alias),C_SYMBOL_DOT_NAME (original)
# else
-# define _hidden_strong_alias(original, alias)
+# define _hidden_strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
# endif
# else
# ifdef HAVE_ASM_GLOBAL_DOT_NAME
-# define _hidden_strong_alias(original, alias)
+# define _hidden_strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original) ASM_LINE_SEP \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_DOT_NAME (alias) = C_SYMBOL_DOT_NAME (original)
# else
-# define _hidden_strong_alias(original, alias)
+# define _hidden_strong_alias(original, alias) \
+ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
# endif
# endif
# ifdef HAVE_ASM_GLOBAL_DOT_NAME
-# define _hidden_weak_alias(original, alias)
+# define _hidden_weak_alias(original, alias) \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .hidden C_SYMBOL_DOT_NAME (alias) ASM_LINE_SEP \
+ weak_alias(original, alias)
# else
-# define _hidden_weak_alias(original, alias)
+# define _hidden_weak_alias(original, alias) \
+ .hidden C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ weak_alias(original, alias)
# endif
/* For assembly, we need to do the opposite of what we do in C:
@@ -448,11 +493,11 @@
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)
-# define hidden_data_def(name)
-# define hidden_weak(name)
-# define hidden_data_weak(name)
-# define HIDDEN_JUMPTARGET(name)
+# define hidden_def(name) _hidden_strong_alias (name, __GI_##name)
+# define hidden_data_def(name) _hidden_strong_alias (name, __GI_##name)
+# define hidden_weak(name) _hidden_weak_alias (name, __GI_##name)
+# define hidden_data_weak(name) _hidden_weak_alias (name, __GI_##name)
+# define HIDDEN_JUMPTARGET(name) __GI_##name
# endif /* __ASSEMBLER__ */
#else /* SHARED */
# ifndef __ASSEMBLER__
diff --git a/include/tls.h b/include/tls.h
index ffd3e4e70..a1da3827b 100644
--- a/include/tls.h
+++ b/include/tls.h
@@ -6,7 +6,7 @@
#include_next <tls.h>
#if USE_TLS && HAVE___THREAD \
- && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+ && (!defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt)
# define USE___THREAD 1
diff --git a/include/unistd.h b/include/unistd.h
index 299283382..3def495ac 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -561,7 +561,7 @@ extern long int pathconf (__const char *__path, int __name)
extern long int fpathconf (int __fd, int __name) __THROW;
/* Get the value of the system variable NAME. */
-extern long int sysconf (int __name) __THROW __attribute__ ((__const__));
+extern long int sysconf (int __name) __THROW;
#ifdef __USE_POSIX2
/* Get the value of the string-valued system variable NAME. */