2004-03-10  Richard Henderson  <rth@redhat.com>

	* sysdeps/generic/errno.c: Disable versioning for rtld.

	* sysdeps/generic/Makefile (elf/shared): Add unwind-pe.
	* sysdeps/generic/unwind-pe.c: New file.
	* sysdeps/generic/unwind-pe.h: Only prototypes for _LIBC without
	_LIBC_DEFINITIONS.

	* posix/regexec.c: Likewise.
This commit is contained in:
Ulrich Drepper 2004-03-10 10:04:19 +00:00
parent 4a381a81fe
commit 78678039a4
6 changed files with 56 additions and 23 deletions

View File

@ -1,3 +1,12 @@
2004-03-10 Richard Henderson <rth@redhat.com>
* sysdeps/generic/errno.c: Disable versioning for rtld.
* sysdeps/generic/Makefile (elf/shared): Add unwind-pe.
* sysdeps/generic/unwind-pe.c: New file.
* sysdeps/generic/unwind-pe.h: Only prototypes for _LIBC without
_LIBC_DEFINITIONS.
2004-03-10 Ulrich Drepper <drepper@redhat.com> 2004-03-10 Ulrich Drepper <drepper@redhat.com>
* include/libc-symbols.h: Define attribute_compat_text_section and * include/libc-symbols.h: Define attribute_compat_text_section and
@ -35,6 +44,7 @@
* sysdeps/unix/sysv/linux/i386/semctl.c: Likewise. * sysdeps/unix/sysv/linux/i386/semctl.c: Likewise.
* sysdeps/unix/sysv/linux/i386/shmctl.c: Likewise. * sysdeps/unix/sysv/linux/i386/shmctl.c: Likewise.
* sysdeps/unix/sysv/linux/i386/versionsort64.c: Likewise. * sysdeps/unix/sysv/linux/i386/versionsort64.c: Likewise.
* posix/regexec.c: Likewise.
* sysdeps/unix/sysv/linux/i386/syscalls.list: vm86@@GLIBC_2.3.4 * sysdeps/unix/sysv/linux/i386/syscalls.list: vm86@@GLIBC_2.3.4
should be the default symbol. Having none misses the point. should be the default symbol. Having none misses the point.

View File

@ -247,6 +247,7 @@ versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
__typeof__ (__regexec) __compat_regexec; __typeof__ (__regexec) __compat_regexec;
int int
attribute_compat_text_section
__compat_regexec (const regex_t *__restrict preg, __compat_regexec (const regex_t *__restrict preg,
const char *__restrict string, size_t nmatch, const char *__restrict string, size_t nmatch,
regmatch_t pmatch[], int eflags) regmatch_t pmatch[], int eflags)

View File

@ -38,7 +38,7 @@ endif
ifeq ($(subdir),elf) ifeq ($(subdir),elf)
ifeq (yes:yes,$(build-shared):$(unwind-find-fde)) ifeq (yes:yes,$(build-shared):$(unwind-find-fde))
# This is needed to support g++ v2 and v3. # This is needed to support g++ v2 and v3.
sysdep_routines += framestate sysdep_routines += framestate unwind-pe
shared-only-routines += framestate shared-only-routines += framestate unwind-pe
endif endif
endif endif

View File

@ -32,9 +32,11 @@ extern __thread int __libc_errno __attribute__ ((alias ("errno")))
int errno __attribute__ ((section (".bss"))); int errno __attribute__ ((section (".bss")));
strong_alias (errno, _errno) strong_alias (errno, _errno)
/* We declare these with compat_symbol so that they are not /* We declare these with compat_symbol so that they are not visible at
visible at link time. Programs must use the accessor functions. */ link time. Programs must use the accessor functions. RTLD is special,
# if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING since it's not exported from there at any time. */
# if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING \
&& !defined IS_IN_rtld
# include <shlib-compat.h> # include <shlib-compat.h>
compat_symbol (libc, errno, errno, GLIBC_2_0); compat_symbol (libc, errno, errno, GLIBC_2_0);
compat_symbol (libc, _errno, _errno, GLIBC_2_0); compat_symbol (libc, _errno, _errno, GLIBC_2_0);

View File

@ -0,0 +1,5 @@
#include <stdlib.h>
#include <unwind.h>
#define _LIBC_DEFINITIONS
#include "unwind-pe.h"

View File

@ -52,23 +52,43 @@
#define DW_EH_PE_indirect 0x80 #define DW_EH_PE_indirect 0x80
#if defined(_LIBC) && !defined(NO_BASE_OF_ENCODED_VALUE) #if defined(_LIBC)
/* Prototypes. */ /* Prototypes. */
extern unsigned int size_of_encoded_value (unsigned char encoding); extern unsigned int size_of_encoded_value (unsigned char encoding)
attribute_hidden;
extern const unsigned char *read_encoded_value_with_base extern const unsigned char *read_encoded_value_with_base
(unsigned char encoding, _Unwind_Ptr base, (unsigned char encoding, _Unwind_Ptr base,
const unsigned char *p, _Unwind_Ptr *val); const unsigned char *p, _Unwind_Ptr *val)
attribute_hidden;
extern const unsigned char * read_encoded_value
(struct _Unwind_Context *context, unsigned char encoding,
const unsigned char *p, _Unwind_Ptr *val)
attribute_hidden;
extern const unsigned char * read_uleb128 (const unsigned char *p,
_Unwind_Word *val)
attribute_hidden;
extern const unsigned char * read_sleb128 (const unsigned char *p,
_Unwind_Sword *val)
attribute_hidden;
#endif
#if defined(_LIBC) && defined(_LIBC_DEFINITIONS)
#ifdef _LIBC
#define STATIC
#else #else
#define STATIC static
#endif
/* Given an encoding, return the number of bytes the format occupies. /* Given an encoding, return the number of bytes the format occupies.
This is only defined for fixed-size encodings, and so does not This is only defined for fixed-size encodings, and so does not
include leb128. */ include leb128. */
# ifndef _LIBC STATIC unsigned int
static
# endif
unsigned int
size_of_encoded_value (unsigned char encoding) size_of_encoded_value (unsigned char encoding)
{ {
if (encoding == DW_EH_PE_omit) if (encoding == DW_EH_PE_omit)
@ -87,7 +107,6 @@ size_of_encoded_value (unsigned char encoding)
} }
__gxx_abort (); __gxx_abort ();
} }
#endif
#ifndef NO_BASE_OF_ENCODED_VALUE #ifndef NO_BASE_OF_ENCODED_VALUE
@ -96,7 +115,7 @@ size_of_encoded_value (unsigned char encoding)
read_encoded_value_with_base for use when the _Unwind_Context is read_encoded_value_with_base for use when the _Unwind_Context is
not available. */ not available. */
static _Unwind_Ptr STATIC _Unwind_Ptr
base_of_encoded_value (unsigned char encoding, struct _Unwind_Context *context) base_of_encoded_value (unsigned char encoding, struct _Unwind_Context *context)
{ {
if (encoding == DW_EH_PE_omit) if (encoding == DW_EH_PE_omit)
@ -126,7 +145,7 @@ base_of_encoded_value (unsigned char encoding, struct _Unwind_Context *context)
hold any value so encoded; if it is smaller than a pointer on some target, hold any value so encoded; if it is smaller than a pointer on some target,
pointers should not be leb128 encoded on that target. */ pointers should not be leb128 encoded on that target. */
static const unsigned char * STATIC const unsigned char *
read_uleb128 (const unsigned char *p, _Unwind_Word *val) read_uleb128 (const unsigned char *p, _Unwind_Word *val)
{ {
unsigned int shift = 0; unsigned int shift = 0;
@ -148,7 +167,7 @@ read_uleb128 (const unsigned char *p, _Unwind_Word *val)
/* Similar, but read a signed leb128 value. */ /* Similar, but read a signed leb128 value. */
static const unsigned char * STATIC const unsigned char *
read_sleb128 (const unsigned char *p, _Unwind_Sword *val) read_sleb128 (const unsigned char *p, _Unwind_Sword *val)
{ {
unsigned int shift = 0; unsigned int shift = 0;
@ -172,15 +191,11 @@ read_sleb128 (const unsigned char *p, _Unwind_Sword *val)
return p; return p;
} }
#if !(defined(_LIBC) && !defined(NO_BASE_OF_ENCODED_VALUE))
/* Load an encoded value from memory at P. The value is returned in VAL; /* Load an encoded value from memory at P. The value is returned in VAL;
The function returns P incremented past the value. BASE is as given The function returns P incremented past the value. BASE is as given
by base_of_encoded_value for this encoding in the appropriate context. */ by base_of_encoded_value for this encoding in the appropriate context. */
# ifndef _LIBC STATIC const unsigned char *
static
# endif
const unsigned char *
read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base, read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base,
const unsigned char *p, _Unwind_Ptr *val) const unsigned char *p, _Unwind_Ptr *val)
{ {
@ -272,14 +287,13 @@ read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base,
*val = result; *val = result;
return p; return p;
} }
#endif
#ifndef NO_BASE_OF_ENCODED_VALUE #ifndef NO_BASE_OF_ENCODED_VALUE
/* Like read_encoded_value_with_base, but get the base from the context /* Like read_encoded_value_with_base, but get the base from the context
rather than providing it directly. */ rather than providing it directly. */
static inline const unsigned char * STATIC const unsigned char *
read_encoded_value (struct _Unwind_Context *context, unsigned char encoding, read_encoded_value (struct _Unwind_Context *context, unsigned char encoding,
const unsigned char *p, _Unwind_Ptr *val) const unsigned char *p, _Unwind_Ptr *val)
{ {
@ -289,3 +303,4 @@ read_encoded_value (struct _Unwind_Context *context, unsigned char encoding,
} }
#endif #endif
#endif /* _LIBC */