diff options
Diffstat (limited to 'sysdeps')
28 files changed, 457 insertions, 177 deletions
diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h index 4166e8c498..173a4111f8 100644 --- a/sysdeps/alpha/dl-machine.h +++ b/sysdeps/alpha/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. Alpha version. - Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1996-2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson <rth@tamu.edu>. @@ -376,6 +376,7 @@ elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc, /* Perform the relocation specified by RELOC and SYM (which is fully resolved). MAP is the object containing the reloc. */ auto inline void +__attribute__ ((always_inline)) elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, const Elf64_Sym *sym, @@ -504,6 +505,7 @@ elf_machine_rela (struct link_map *map, #define ELF_MACHINE_REL_RELATIVE 1 auto inline void +__attribute__ ((always_inline)) elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, void *const reloc_addr_arg) { @@ -520,6 +522,7 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, } auto inline void +__attribute__ ((always_inline)) elf_machine_lazy_rel (struct link_map *map, Elf64_Addr l_addr, const Elf64_Rela *reloc) { diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h index 7ddd81234b..0fe47b2f80 100644 --- a/sysdeps/arm/dl-machine.h +++ b/sysdeps/arm/dl-machine.h @@ -353,7 +353,7 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rel *reloc, /* ARM never uses Elf32_Rela relocations for the dynamic linker. Prelinked libraries may use Elf32_Rela though. */ -#define ELF_MACHINE_NO_RELA (defined RTLD_BOOTSTRAP) +#define ELF_MACHINE_NO_RELA defined RTLD_BOOTSTRAP #ifdef RESOLVE @@ -391,7 +391,8 @@ fix_bad_pc24 (Elf32_Addr *const reloc_addr, Elf32_Addr value) /* Perform the relocation specified by RELOC and SYM (which is fully resolved). MAP is the object containing the reloc. */ -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, const Elf32_Sym *sym, const struct r_found_version *version, void *const reloc_addr_arg) @@ -516,7 +517,8 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, } # ifndef RTLD_BOOTSTRAP -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, const Elf32_Sym *sym, const struct r_found_version *version, void *const reloc_addr_arg) @@ -596,7 +598,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, } # endif -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc, void *const reloc_addr_arg) { @@ -605,7 +608,8 @@ elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc, } # ifndef RTLD_BOOTSTRAP -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, void *const reloc_addr_arg) { @@ -614,7 +618,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, } # endif -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_lazy_rel (struct link_map *map, Elf32_Addr l_addr, const Elf32_Rel *reloc) { diff --git a/sysdeps/generic/dl-machine.h b/sysdeps/generic/dl-machine.h index 8b4425cea4..c3459f5e32 100644 --- a/sysdeps/generic/dl-machine.h +++ b/sysdeps/generic/dl-machine.h @@ -1,5 +1,6 @@ /* Machine-dependent ELF dynamic relocation inline functions. Stub version. - Copyright (C) 1995,1996,1997,1999,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1999, 2000, 2001, 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 @@ -64,7 +65,8 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t t, LOADADDR is the load address of the object; INFO is an array indexed by DT_* of the .dynamic section info. */ -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_rel (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM], const Elf32_Rel *reloc, const Elf32_Sym *sym, Elf32_Addr (*resolve) (const Elf32_Sym **ref, @@ -87,7 +89,8 @@ elf_machine_rel (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM], } -static inline Elf32_Addr +auto inline Elf32_Addr +__attribute__ ((always_inline)) elf_machine_rela (Elf32_Addr loadaddr, Elf32_Dyn *info[DT_NUM], const Elf32_Rel *reloc, const Elf32_Sym *sym, Elf32_Addr (*resolve) (const Elf32_Sym **ref, diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 08039e18ca..dd1b2c8345 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -694,10 +694,7 @@ extern char **_dl_argv_internal attribute_hidden /* The array with message we print as a last resort. */ extern const char _dl_out_of_memory[]; -#ifdef IS_IN_rtld -/* XXX #ifdef should go away. */ -extern const char _dl_out_of_memory_internal[] attribute_hidden; -#endif +rtld_hidden_proto (_dl_out_of_memory) /* Flag set at startup and cleared when the last initializer has run. */ extern int _dl_starting_up; @@ -895,6 +892,11 @@ extern void _dl_init (struct link_map *main_map, int argc, char **argv, initializer functions have completed. */ extern void _dl_fini (void) internal_function; +/* Sort array MAPS according to dependencies of the contained objects. */ +extern void _dl_sort_fini (struct link_map *l, struct link_map **maps, + size_t nmaps, char *used, Lmid_t ns) + internal_function; + /* The dynamic linker calls this function before and having changing any shared object mappings. The `r_state' member of `struct r_debug' says what change is taking place. This function's address is diff --git a/sysdeps/generic/strchrnul.c b/sysdeps/generic/strchrnul.c index f04b303b82..88b96dd126 100644 --- a/sysdeps/generic/strchrnul.c +++ b/sysdeps/generic/strchrnul.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,93,94,95,96,97,99,2000 Free Software Foundation, Inc. +/* Copyright (C) 1991,1993-1997,99,2000,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se) and @@ -43,8 +43,8 @@ __strchrnul (s, c_in) /* Handle the first few characters by reading one character at a time. Do this until CHAR_PTR is aligned on a longword boundary. */ - for (char_ptr = s; ((unsigned long int) char_ptr - & (sizeof (longword) - 1)) != 0; + for (char_ptr = (const unsigned char *) s; + ((unsigned long int) char_ptr & (sizeof (longword) - 1)) != 0; ++char_ptr) if (*char_ptr == c || *char_ptr == '\0') return (void *) char_ptr; diff --git a/sysdeps/generic/tls-macros.h b/sysdeps/generic/tls-macros.h new file mode 100644 index 0000000000..0a08f7c145 --- /dev/null +++ b/sysdeps/generic/tls-macros.h @@ -0,0 +1,12 @@ +/* Macros to support TLS testing in times of missing compiler support. + Stub version. + + These macros should yield int * expressions for the TLS symbol X + accessed using the various TLS access models. Macros for some machines + are defined in elf/tls-macros.h, but ports can instead provide this file. + +#define TLS_LE(x) +#define TLS_IE(x) +#define TLS_LD(x) +#define TLS_GD(x) +*/ diff --git a/sysdeps/generic/wordexp.c b/sysdeps/generic/wordexp.c index c3d382fb95..06d38f6b24 100644 --- a/sysdeps/generic/wordexp.c +++ b/sysdeps/generic/wordexp.c @@ -809,7 +809,7 @@ parse_arith (char **word, size_t *word_length, size_t *max_length, } /* Function called by child process in exec_comm() */ -static void +static inline void internal_function __attribute__ ((always_inline)) exec_comm_child (char *comm, int *fildes, int showerr, int noexec) { diff --git a/sysdeps/gnu/errlist-compat.awk b/sysdeps/gnu/errlist-compat.awk index db827f3f70..2fb5fd906d 100644 --- a/sysdeps/gnu/errlist-compat.awk +++ b/sysdeps/gnu/errlist-compat.awk @@ -90,7 +90,7 @@ END { n = vcount[old]; printf "#if SHLIB_COMPAT (libc, %s, %s)\n", old, new; printf "# include <bits/wordsize.h>\n"; - printf "extern const char *const __sys_errlist_%s[];\n", old; + printf "extern const char *const __sys_errlist_%s[NERR];\n", old; printf "const int __sys_nerr_%s = %d;\n", old, n; printf "strong_alias (_sys_errlist_internal, __sys_errlist_%s)\n", old; printf "declare_symbol (__sys_errlist_%s, object, __WORDSIZE/8*%d)\n", \ @@ -99,7 +99,7 @@ END { old, old; printf "compat_symbol (libc, __sys_nerr_%s, sys_nerr, %s);\n", old, old; - printf "extern const char *const ___sys_errlist_%s[];\n", old; + printf "extern const char *const ___sys_errlist_%s[NERR];\n", old; printf "extern const int __sys_nerr_%s;\n", old; printf "strong_alias (__sys_errlist_%s, ___sys_errlist_%s)\n", old, old; printf "strong_alias (__sys_nerr_%s, ___sys_nerr_%s)\n", old, old; @@ -110,10 +110,11 @@ END { } printf "\ -extern const char *const __sys_errlist_internal[];\n\ +extern const char *const __sys_errlist_internal[NERR];\n\ extern const int __sys_nerr_internal;\n\ strong_alias (_sys_errlist_internal, __sys_errlist_internal)\n\ strong_alias (_sys_nerr_internal, __sys_nerr_internal)\n\ +extern const char *const sys_errlist[NERR];\n\ versioned_symbol (libc, _sys_errlist_internal, sys_errlist, %s);\n\ versioned_symbol (libc, __sys_errlist_internal, _sys_errlist, %s);\n\ versioned_symbol (libc, _sys_nerr_internal, sys_nerr, %s);\n\ diff --git a/sysdeps/gnu/errlist.awk b/sysdeps/gnu/errlist.awk index 3f074ed482..365ac817c7 100644 --- a/sysdeps/gnu/errlist.awk +++ b/sysdeps/gnu/errlist.awk @@ -1,4 +1,4 @@ -# Copyright (C) 1991-1999,2002,2004 Free Software Foundation, Inc. +# Copyright (C) 1991-1999,2002,2004,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 @@ -106,8 +106,9 @@ errnoh == 4 \ END { print " };"; print ""; - print "const int _sys_nerr_internal"; - print " = sizeof _sys_errlist_internal / sizeof _sys_errlist_internal [0];"; + print "#define NERR \\"; + print " (sizeof _sys_errlist_internal / sizeof _sys_errlist_internal [0])"; + print "const int _sys_nerr_internal = NERR;" print ""; print "#if !defined NOT_IN_libc && !ERRLIST_NO_COMPAT"; print "# include <errlist-compat.c>"; diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c index 9ae6ec3c1d..1508311a4a 100644 --- a/sysdeps/gnu/errlist.c +++ b/sysdeps/gnu/errlist.c @@ -1410,8 +1410,9 @@ TRANS error; @pxref{Cancel AIO Operations}. */ #endif }; -const int _sys_nerr_internal - = sizeof _sys_errlist_internal / sizeof _sys_errlist_internal [0]; +#define NERR \ + (sizeof _sys_errlist_internal / sizeof _sys_errlist_internal [0]) +const int _sys_nerr_internal = NERR; #if !defined NOT_IN_libc && !ERRLIST_NO_COMPAT # include <errlist-compat.c> diff --git a/sysdeps/hppa/configure b/sysdeps/hppa/configure index 07bde0e0ee..bc01e46b6c 100755 --- a/sysdeps/hppa/configure +++ b/sysdeps/hppa/configure @@ -1,6 +1,5 @@ # This file is generated from configure.in by Autoconf. DO NOT EDIT! -hppa*linux*) echo "$as_me:$LINENO: checking for assembler line separator" >&5 echo $ECHO_N "checking for assembler line separator... $ECHO_C" >&6 if test "${libc_cv_asm_line_sep+set}" = set; then diff --git a/sysdeps/hppa/configure.in b/sysdeps/hppa/configure.in index 1ec6780835..1ec417b947 100644 --- a/sysdeps/hppa/configure.in +++ b/sysdeps/hppa/configure.in @@ -2,7 +2,6 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. dnl The standard hppa assembler uses `;' to start comments and `!' dnl as a line separator. -hppa*linux*) AC_CACHE_CHECK(for assembler line separator, libc_cv_asm_line_sep, [dnl cat > conftest.s <<EOF diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile index ece94f3610..ddd3d04e07 100644 --- a/sysdeps/i386/Makefile +++ b/sysdeps/i386/Makefile @@ -8,7 +8,7 @@ long-double-fcts = yes ifeq ($(subdir),csu) # On i686 we must avoid generating the trampoline functions generated # to get the GOT pointer. -CFLAGS-initfini.s += -march=i386 -mcpu=i386 +CFLAGS-initfini.s += -march=i386 -mtune=i386 endif ifeq ($(subdir),gmon) diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure index d1d4dc15a7..ecba16645b 100755 --- a/sysdeps/i386/configure +++ b/sysdeps/i386/configure @@ -52,3 +52,6 @@ if test $libc_cv_cpp_asm_debuginfo = yes; then _ACEOF fi + +# Tell top-level configure to try -mtune=i386. +libc_mtune_example=i386 diff --git a/sysdeps/i386/configure.in b/sysdeps/i386/configure.in index 028e1ae8e1..93b62b671c 100644 --- a/sysdeps/i386/configure.in +++ b/sysdeps/i386/configure.in @@ -33,3 +33,6 @@ rm -f conftest*])AC_SUBST(libc_cv_cpp_asm_debuginfo) if test $libc_cv_cpp_asm_debuginfo = yes; then AC_DEFINE(HAVE_CPP_ASM_DEBUGINFO) fi + +# Tell top-level configure to try -mtune=i386. +libc_mtune_example=i386 diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index 367a4fb1a8..df3edf5460 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -301,7 +301,7 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rel *reloc, /* The i386 never uses Elf32_Rela relocations for the dynamic linker. Prelinked libraries may use Elf32_Rela though. */ -#define ELF_MACHINE_NO_RELA (defined RTLD_BOOTSTRAP) +#define ELF_MACHINE_NO_RELA defined RTLD_BOOTSTRAP #ifdef RESOLVE_MAP diff --git a/sysdeps/i386/i486/Makefile b/sysdeps/i386/i486/Makefile deleted file mode 100644 index 930731a166..0000000000 --- a/sysdeps/i386/i486/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -# Temporary workaround for GCC4 PR debug/19345 -ifeq ($(subdir),string) -CFLAGS-string-inlines.c += -g0 -endif diff --git a/sysdeps/i386/i686/hp-timing.h b/sysdeps/i386/i686/hp-timing.h index a5906835f7..b924869649 100644 --- a/sysdeps/i386/i686/hp-timing.h +++ b/sysdeps/i386/i686/hp-timing.h @@ -1,5 +1,5 @@ /* High precision, low overhead timing functions. i686 version. - Copyright (C) 1998, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -119,26 +119,24 @@ typedef unsigned long long int hp_timing_t; /* We have to jump through hoops to get this correctly implemented. */ #define HP_TIMING_ACCUM(Sum, Diff) \ do { \ - char __not_done; \ + int __not_done; \ hp_timing_t __oldval = (Sum); \ hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead); \ do \ { \ hp_timing_t __newval = __oldval + __diff; \ int __temp0, __temp1; \ - __asm__ __volatile__ ("xchgl %4, %%ebx\n\t" \ + __asm__ __volatile__ ("xchgl %0, %%ebx\n\t" \ "lock; cmpxchg8b %1\n\t" \ - "sete %0\n\t" \ - "movl %4, %%ebx" \ - : "=q" (__not_done), "=m" (Sum), \ - "=A" (__oldval), "=c" (__temp0), \ - "=SD" (__temp1) \ - : "1" (Sum), "2" (__oldval), \ - "3" (__newval >> 32), \ - "4" (__newval & 0xffffffff) \ - : "memory"); \ + "sete %%bl\n\t" \ + "xchgl %0, %%ebx" \ + : "=SD" (__not_done), "=m" (Sum), \ + "=A" (__oldval), "=c" (__temp0) \ + : "m" (Sum), "2" (__oldval), \ + "3" ((unsigned int) (__newval >> 32)), \ + "0" ((unsigned int) __newval)); \ } \ - while (__not_done); \ + while ((unsigned char) __not_done); \ } while (0) /* No threads, no extra work. */ diff --git a/sysdeps/powerpc/bits/link.h b/sysdeps/powerpc/bits/link.h index f8e6734fe0..6c6f6042a1 100644 --- a/sysdeps/powerpc/bits/link.h +++ b/sysdeps/powerpc/bits/link.h @@ -71,7 +71,8 @@ typedef struct La_ppc64_regs { uint64_t lr_reg[8]; double lr_fp[13]; - uint64_t __padding; + uint32_t __padding; + uint32_t lr_vrsave; uint32_t lr_vreg[12][4]; uint64_t lr_r1; uint64_t lr_lr; @@ -82,8 +83,8 @@ typedef struct La_ppc64_retval { uint64_t lrv_r3; uint64_t lrv_r4; - double lrv_fp[8]; - uint32_t lrv_v2[4]; + double lrv_fp[4]; /* f1-f4, float - complex long double. */ + uint32_t lrv_v2[4]; /* v2. */ } La_ppc64_retval; diff --git a/sysdeps/powerpc/powerpc64/dl-trampoline.S b/sysdeps/powerpc/powerpc64/dl-trampoline.S index 316f17a405..0c617063c9 100644 --- a/sysdeps/powerpc/powerpc64/dl-trampoline.S +++ b/sysdeps/powerpc/powerpc64/dl-trampoline.S @@ -18,9 +18,15 @@ 02111-1307 USA. */ #include <sysdep.h> +#include <rtld-global-offsets.h> - .section ".text" + .section ".text" +/* On entry r0 contains the index of the PLT entry we need to fixup + and r11 contains the link_map (from PLT0+16). The link_map becomes + parm1 (r3) and the index (r0) need to be converted to an offset + (index * 24) in parm2 (r4). */ + EALIGN(_dl_runtime_resolve, 4, 0) /* We need to save the registers used to pass parameters, ie. r3 thru r10; the registers are saved in a stack frame. */ @@ -68,129 +74,362 @@ EALIGN(_dl_runtime_resolve, 4, 0) bctr END(_dl_runtime_resolve) + /* Stack layout: + +592 previous backchain + +584 spill_r31 + +576 spill_r30 + +560 v1 + +552 fp4 + +544 fp3 + +536 fp2 + +528 fp1 + +520 r4 + +512 r3 + return values + +504 free + +496 stackframe + +488 lr + +480 r1 + +464 v13 + +448 v12 + +432 v11 + +416 v10 + +400 v9 + +384 v8 + +368 v7 + +352 v6 + +336 v5 + +320 v4 + +304 v3 + +288 v2 + * VMX Parms in V2-V13, V0-V1 are scratch + +284 vrsave + +280 free + +272 fp13 + +264 fp12 + +256 fp11 + +248 fp10 + +240 fp9 + +232 fp8 + +224 fp7 + +216 fp6 + +208 fp5 + +200 fp4 + +192 fp3 + +184 fp2 + +176 fp1 + * FP Parms in FP1-FP13, FP0 is a scratch register + +168 r10 + +160 r9 + +152 r8 + +144 r7 + +136 r6 + +128 r5 + +120 r4 + +112 r3 + * Integer parms in R3-R10, R0 is scratch, R1 SP, R2 is TOC + +104 parm8 + +96 parm7 + +88 parm6 + +80 parm5 + +72 parm4 + +64 parm3 + +56 parm2 + +48 parm1 + * Parameter save area, Allocated by the call, at least 8 double words + +40 TOC save area + +32 Reserved for linker + +24 Reserved for compiler + +16 LR save area + +8 CR save area + r1+0 stack back chain + */ +#define FRAME_SIZE 592 +#define INT_RTN 512 +#define FPR_RTN 528 +#define VR_RTN 560 +#define STACK_FRAME 496 +#define CALLING_LR 488 +#define CALLING_SP 480 +#define INT_PARMS 112 +#define FPR_PARMS 176 +#define VR_PARMS 288 +#define VR_VRSAVE 284 + .section ".toc","aw" +.LC__dl_hwcap: +# ifdef SHARED + .tc _rtld_global_ro[TC],_rtld_global_ro +# else + .tc _dl_hwcap[TC],_dl_hwcap +# endif + .section ".text" - + .machine "altivec" +/* On entry r0 contains the index of the PLT entry we need to fixup + and r11 contains the link_map (from PLT0+16). The link_map becomes + parm1 (r3) and the index (r0) needs to be converted to an offset + (index * 24) in parm2 (r4). */ + EALIGN(_dl_profile_resolve, 4, 0) +/* Spill r30, r31 to preserve the link_map* and reloc_addr, in case we + need to call _dl_call_pltexit. */ + std r31,-8(r1) + std r30,-16(r1) /* We need to save the registers used to pass parameters, ie. r3 thru r10; the registers are saved in a stack frame. */ - stdu r1,-448(r1) - /* Stack layout: - - +432 stackframe - +424 lr - +416 r1 - +400 v12 - +384 v11 - +368 v10 - +362 v9 - +336 v8 - +320 v7 - +304 v6 - +288 v5 - +272 v4 - +256 v3 - +240 v2 - +224 v1 - +216 free - +208 fp13 - +200 fp12 - +192 fp11 - +184 fp10 - +176 fp9 - +168 fp8 - +160 fp7 - +152 fp6 - +144 fp5 - +136 fp4 - +128 fp3 - +120 fp2 - +112 fp1 - +104 r10 - +96 r9 - +88 r8 - +80 r7 - +72 r6 - +64 r5 - +56 r4 - +48 r3 - +8 cr - r1 link - */ - std r3,48(r1) + stdu r1,-FRAME_SIZE(r1) + std r3,INT_PARMS+0(r1) mr r3,r11 - std r4,56(r1) - sldi r4,r0,1 - std r5,64(r1) - add r4,r4,0 - std r6,72(r1) - sldi r4,r4,3 - std r7,80(r1) + std r4,INT_PARMS+8(r1) + sldi r4,r0,1 /* index * 2 */ + std r5,INT_PARMS+16(r1) + add r4,r4,r0 /* index * 3 */ + std r6,INT_PARMS+24(r1) + sldi r4,r4,3 /* index * 24 == PLT offset */ mflr r5 - std r8,88(r1) + std r7,INT_PARMS+32(r1) + std r8,INT_PARMS+40(r1) /* Store the LR in the LR Save area of the previous frame. */ /* XXX Do we have to do this? */ - std r5,448+16(r1) - std r5,424(r1) + la r8,FRAME_SIZE(r1) + std r5,FRAME_SIZE+16(r1) + std r5,CALLING_LR(r1) mfcr r0 - std r9,96(r1) - std r10,104(r1) + std r9,INT_PARMS+48(r1) + std r10,INT_PARMS+56(r1) + std r8,CALLING_SP(r1) /* I'm almost certain we don't have to save cr... be safe. */ std r0,8(r1) + ld r12,.LC__dl_hwcap@toc(r2) +#ifdef SHARED + /* Load _rtld-global._dl_hwcap. */ + ld r12,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r12) +#else + ld r12,0(r12) /* Load extern _dl_hwcap. */ +#endif + andis. r0,r12,(PPC_FEATURE_HAS_ALTIVEC >> 16) + beq L(saveFP) + la r10,(VR_PARMS+0)(r1) + la r9,(VR_PARMS+16)(r1) + li r11,32 + li r12,64 + stvx v2,0,r10 + stvx v3,0,r9 + + stvx v4,r11,r10 + stvx v5,r11,r9 + addi r11,r11,64 + + stvx v6,r12,r10 + stvx v7,r12,r9 + addi r12,r12,64 + + stvx v8,r11,r10 + stvx v9,r11,r9 + addi r11,r11,64 + + stvx v10,r12,r10 + stvx v11,r12,r9 + mfspr r0,VRSAVE + + stvx v12,r11,r10 + stvx v13,r11,r9 +L(saveFP): + stw r0,VR_VRSAVE(r1) /* Save floating registers. */ - stfd fp1,112(r1) - stfd fp2,120(r1) - stfd fp3,128(r1) - stfd fp4,136(r1) - stfd fp5,144(r1) - stfd fp6,152(r1) - stfd fp7,160(r1) - stfd fp8,168(r1) - stfd fp9,176(r1) - stfd fp10,184(r1) - stfd fp11,192(r1) - stfd fp12,200(r1) - stfd fp13,208(r1) -/* XXX TODO: store vmx registers. */ -/* Load the extra parameters. */ - addi r6,r1,48 - addi r7,r1,432 + stfd fp1,FPR_PARMS+0(r1) + stfd fp2,FPR_PARMS+8(r1) + stfd fp3,FPR_PARMS+16(r1) + stfd fp4,FPR_PARMS+24(r1) + stfd fp5,FPR_PARMS+32(r1) + stfd fp6,FPR_PARMS+40(r1) + stfd fp7,FPR_PARMS+48(r1) + stfd fp8,FPR_PARMS+56(r1) + stfd fp9,FPR_PARMS+64(r1) + stfd fp10,FPR_PARMS+72(r1) + stfd fp11,FPR_PARMS+80(r1) li r0,-1 - stdu r0,0(r7) + stfd fp12,FPR_PARMS+88(r1) + stfd fp13,FPR_PARMS+96(r1) +/* Load the extra parameters. */ + addi r6,r1,INT_PARMS + addi r7,r1,STACK_FRAME +/* Save link_map* and reloc_addr parms for later. */ + mr r31,r3 + mr r30,r4 + std r0,0(r7) bl JUMPTARGET(_dl_profile_fixup) -/* Put the registers back. */ - ld r0,448+16(r1) - ld r10,104(r1) - ld r9,96(r1) - ld r8,88(r1) - ld r7,80(r1) + nop +/* Test *framesizep > 0 to see if need to do pltexit processing. */ + ld r0,STACK_FRAME(r1) +/* Put the registers back. */ + lwz r12,VR_VRSAVE(r1) + cmpdi cr1,r0,0 + cmpdi cr0,r12,0 + bgt cr1,L(do_pltexit) + la r10,(VR_PARMS+0)(r1) + la r9,(VR_PARMS+16)(r1) +/* VRSAVE must be non-zero if VMX is present and VRs are in use. */ + beq L(restoreFXR) + li r11,32 + li r12,64 + lvx v2,0,r10 + lvx v3,0,r9 + + lvx v4,r11,r10 + lvx v5,r11,r9 + addi r11,r11,64 + + lvx v6,r12,r10 + lvx v7,r12,r9 + addi r12,r12,64 + + lvx v8,r11,r10 + lvx v9,r11,r9 + addi r11,r11,64 + + lvx v10,r12,r10 + lvx v11,r12,r9 + + lvx v12,r11,r10 + lvx v13,r11,r9 +L(restoreFXR): + ld r0,FRAME_SIZE+16(r1) + ld r10,INT_PARMS+56(r1) + ld r9,INT_PARMS+48(r1) + ld r8,INT_PARMS+40(r1) + ld r7,INT_PARMS+32(r1) mtlr r0 ld r0,8(r1) - ld r6,72(r1) - ld r5,64(r1) - ld r4,56(r1) + ld r6,INT_PARMS+24(r1) + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) mtcrf 0xFF,r0 /* Load the target address, toc and static chain reg from the function descriptor returned by fixup. */ ld r0,0(r3) ld r2,8(r3) - mtctr r0 ld r11,16(r3) - ld r3,48(r1) + ld r3,INT_PARMS+0(r1) + mtctr r0 /* Load the floating point registers. */ - lfd fp1,112(r1) - lfd fp2,120(r1) - lfd fp3,128(r1) - lfd fp4,136(r1) - lfd fp5,144(r1) - lfd fp6,152(r1) - lfd fp7,160(r1) - lfd fp8,168(r1) - lfd fp9,176(r1) - lfd fp10,184(r1) - lfd fp11,192(r1) - lfd fp12,200(r1) - lfd fp13,208(r1) + lfd fp1,FPR_PARMS+0(r1) + lfd fp2,FPR_PARMS+8(r1) + lfd fp3,FPR_PARMS+16(r1) + lfd fp4,FPR_PARMS+24(r1) + lfd fp5,FPR_PARMS+32(r1) + lfd fp6,FPR_PARMS+40(r1) + lfd fp7,FPR_PARMS+48(r1) + lfd fp8,FPR_PARMS+56(r1) + lfd fp9,FPR_PARMS+64(r1) + lfd fp10,FPR_PARMS+72(r1) + lfd fp11,FPR_PARMS+80(r1) + lfd fp12,FPR_PARMS+88(r1) + lfd fp13,FPR_PARMS+96(r1) /* Unwind the stack frame, and jump. */ - addi r1,r1,448 + ld r31,584(r1) + ld r30,576(r1) + addi r1,r1,FRAME_SIZE bctr +L(do_pltexit): + la r10,(VR_PARMS+0)(r1) + la r9,(VR_PARMS+16)(r1) + beq L(restoreFXR2) + li r11,32 + li r12,64 + lvx v2,0,r10 + lvx v3,0,r9 + + lvx v4,r11,r10 + lvx v5,r11,r9 + addi r11,r11,64 + + lvx v6,r12,r10 + lvx v7,r12,r9 + addi r12,r12,64 + + lvx v8,r11,r10 + lvx v9,r11,r9 + addi r11,r11,64 + + lvx v10,r12,r10 + lvx v11,r12,r9 + + lvx v12,r11,r10 + lvx v13,r11,r9 +L(restoreFXR2): + ld r0,FRAME_SIZE+16(r1) + ld r10,INT_PARMS+56(r1) + ld r9,INT_PARMS+48(r1) + ld r8,INT_PARMS+40(r1) + ld r7,INT_PARMS+32(r1) + mtlr r0 + ld r0,8(r1) + ld r6,INT_PARMS+24(r1) + ld r5,INT_PARMS+16(r1) + ld r4,INT_PARMS+8(r1) + mtcrf 0xFF,r0 +/* Load the target address, toc and static chain reg from the function + descriptor returned by fixup. */ + ld r0,0(r3) + std r2,40(r1) + ld r2,8(r3) + ld r11,16(r3) + ld r3,INT_PARMS+0(r1) + mtctr r0 +/* Load the floating point registers. */ + lfd fp1,FPR_PARMS+0(r1) + lfd fp2,FPR_PARMS+8(r1) + lfd fp3,FPR_PARMS+16(r1) + lfd fp4,FPR_PARMS+24(r1) + lfd fp5,FPR_PARMS+32(r1) + lfd fp6,FPR_PARMS+40(r1) + lfd fp7,FPR_PARMS+48(r1) + lfd fp8,FPR_PARMS+56(r1) + lfd fp9,FPR_PARMS+64(r1) + lfd fp10,FPR_PARMS+72(r1) + lfd fp11,FPR_PARMS+80(r1) + lfd fp12,FPR_PARMS+88(r1) + lfd fp13,FPR_PARMS+96(r1) +/* Call the target function. */ + bctrl + ld r2,40(r1) + lwz r12,VR_VRSAVE(r1) +/* But return here and store the return values. */ + std r3,INT_RTN(r1) + std r4,INT_RTN+8(r1) + stfd fp1,FPR_PARMS+0(r1) + stfd fp2,FPR_PARMS+8(r1) + cmpdi cr0,r12,0 + la r10,VR_RTN(r1) + stfd fp3,FPR_PARMS+16(r1) + stfd fp4,FPR_PARMS+24(r1) + mr r3,r31 + mr r4,r30 + beq L(callpltexit) + stvx v2,0,r10 +L(callpltexit): + addi r5,r1,INT_PARMS + addi r6,r1,INT_RTN + bl JUMPTARGET(_dl_call_pltexit) + nop +/* Restore the return values from target function. */ + lwz r12,VR_VRSAVE(r1) + ld r3,INT_RTN(r1) + ld r4,INT_RTN+8(r1) + lfd fp1,FPR_PARMS+0(r1) + lfd fp2,FPR_PARMS+8(r1) + cmpdi cr0,r12,0 + la r10,VR_RTN(r1) + lfd fp3,FPR_PARMS+16(r1) + lfd fp4,FPR_PARMS+24(r1) + beq L(pltexitreturn) + lvx v2,0,r10 +L(pltexitreturn): + ld r0,FRAME_SIZE+16(r1) + ld r31,584(r1) + ld r30,576(r1) + mtlr r0 + ld r1,0(r1) + blr END(_dl_profile_resolve) diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h index 52fc6329dd..d0af232d48 100644 --- a/sysdeps/sparc/sparc32/dl-machine.h +++ b/sysdeps/sparc/sparc32/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. SPARC version. - Copyright (C) 1996-2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1996-2003, 2004, 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 @@ -411,7 +411,8 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, /* Perform the relocation specified by RELOC and SYM (which is fully resolved). MAP is the object containing the reloc. */ -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, const Elf32_Sym *sym, const struct r_found_version *version, void *const reloc_addr_arg) @@ -593,7 +594,8 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, } } -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, void *const reloc_addr_arg) { @@ -601,7 +603,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, *reloc_addr += l_addr + reloc->r_addend; } -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_lazy_rel (struct link_map *map, Elf32_Addr l_addr, const Elf32_Rela *reloc) { diff --git a/sysdeps/sparc/sparc64/dl-machine.h b/sysdeps/sparc/sparc64/dl-machine.h index 474aa0e6e6..72b88e235c 100644 --- a/sysdeps/sparc/sparc64/dl-machine.h +++ b/sysdeps/sparc/sparc64/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. Sparc64 version. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -238,7 +238,8 @@ elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc, /* Perform the relocation specified by RELOC and SYM (which is fully resolved). MAP is the object containing the reloc. */ -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, const Elf64_Sym *sym, const struct r_found_version *version, void *const reloc_addr_arg) @@ -430,7 +431,8 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc, } } -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, void *const reloc_addr_arg) { @@ -438,7 +440,8 @@ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc, *reloc_addr = l_addr + reloc->r_addend; } -static inline void +auto inline void +__attribute__ ((always_inline)) elf_machine_lazy_rel (struct link_map *map, Elf64_Addr l_addr, const Elf64_Rela *reloc) { diff --git a/sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h deleted file mode 100644 index e69de29bb2..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h +++ /dev/null diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h index a499a80ef9..9eb50aa96b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h +++ b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2002, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1998, 1999, 2002, 2004, 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 @@ -70,8 +70,6 @@ typedef struct * can be refernced safely only after verifying that PPC_FEATURE_HAS_ALTIVEC * is set in AT_HWCAP. */ -# include <asm/types.h> - /* Number of general registers. */ # define NGREG 48 /* includes r0-r31, nip, msr, lr, etc. */ # define NFPREG 33 /* includes fp0-fp31 &fpscr. */ diff --git a/sysdeps/unix/sysv/linux/sh/bits/mman.h b/sysdeps/unix/sysv/linux/sh/bits/mman.h index 673c7295fb..656b5b673b 100644 --- a/sysdeps/unix/sysv/linux/sh/bits/mman.h +++ b/sysdeps/unix/sysv/linux/sh/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/SH version. - Copyright (C) 1997, 1999, 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 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 @@ -61,6 +61,8 @@ # define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */ # define MAP_LOCKED 0x2000 /* Lock the mapping. */ # define MAP_NORESERVE 0x4000 /* Don't check for reservations. */ +# define MAP_POPULATE 0x8000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ #endif /* Flags to `msync'. */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/mman.h b/sysdeps/unix/sysv/linux/sparc/bits/mman.h index cc4917a54b..410a38e8a5 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/mman.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/mman.h @@ -1,5 +1,5 @@ /* Definitions for POSIX memory map interface. Linux/SPARC version. - Copyright (C) 1997, 1999, 2000, 2003 Free Software Foundation, Inc. + Copyright (C) 1997, 1999, 2000, 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 @@ -57,12 +57,14 @@ /* These are Linux-specific. */ #ifdef __USE_MISC -# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */ +# define MAP_GROWSDOWN 0x0200 /* Stack-like segment. */ # define MAP_DENYWRITE 0x0800 /* ETXTBSY */ # define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */ # define MAP_LOCKED 0x0100 /* Lock the mapping. */ # define MAP_NORESERVE 0x0040 /* Don't check for reservations. */ # define _MAP_NEW 0x80000000 /* Binary compatibility with SunOS. */ +# define MAP_POPULATE 0x8000 /* Populate (prefault) pagetables. */ +# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */ #endif /* Flags to `msync'. */ diff --git a/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/sysdeps/unix/sysv/linux/x86_64/makecontext.c index c763556b93..6597d8980b 100644 --- a/sysdeps/unix/sysv/linux/x86_64/makecontext.c +++ b/sysdeps/unix/sysv/linux/x86_64/makecontext.c @@ -1,5 +1,5 @@ /* Create new context. - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 2002. @@ -20,6 +20,7 @@ #include <sysdep.h> #include <stdarg.h> +#include <stdint.h> #include <ucontext.h> #include "ucontext_i.h" @@ -52,28 +53,29 @@ void __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) { extern void __start_context (void); - unsigned long *sp, idx_uc_link; + unsigned long int *sp, idx_uc_link; va_list ap; int i; /* Generate room on stack for parameter if needed and uc_link. */ - sp = (long *) ((long) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); + sp = (unsigned long int *) ((uintptr_t) ucp->uc_stack.ss_sp + + ucp->uc_stack.ss_size); sp -= (argc > 6 ? argc - 6 : 0) + 1; /* Align stack and make space for trampoline address. */ - sp = (long *) ((((long) sp) & -16L) - 8); + sp = (unsigned long int *) ((((uintptr_t) sp) & -16L) - 8); idx_uc_link = (argc > 6 ? argc - 6 : 0) + 1; /* Setup context ucp. */ /* Address to jump to. */ - ucp->uc_mcontext.gregs[REG_RIP] = (long) func; + ucp->uc_mcontext.gregs[REG_RIP] = (long int) func; /* Setup rbx.*/ - ucp->uc_mcontext.gregs[REG_RBX] = (long) &sp[idx_uc_link]; - ucp->uc_mcontext.gregs[REG_RSP] = (long) sp; + ucp->uc_mcontext.gregs[REG_RBX] = (long int) &sp[idx_uc_link]; + ucp->uc_mcontext.gregs[REG_RSP] = (long int) sp; /* Setup stack. */ - sp[0] = (long) &__start_context; - sp[idx_uc_link] = (long) ucp->uc_link; + sp[0] = (unsigned long int) &__start_context; + sp[idx_uc_link] = (unsigned long int) ucp->uc_link; va_start (ap, argc); /* Handle arguments. */ diff --git a/sysdeps/x86_64/hp-timing.h b/sysdeps/x86_64/hp-timing.h index e015ff79db..59a29abd45 100644 --- a/sysdeps/x86_64/hp-timing.h +++ b/sysdeps/x86_64/hp-timing.h @@ -1,5 +1,5 @@ /* High precision, low overhead timing functions. x86-64 version. - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 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 @@ -31,7 +31,11 @@ /* The funny business for 32-bit mode is not required here. */ # undef HP_TIMING_ACCUM -# define HP_TIMING_ACCUM(Sum, Diff) ((Sum) += (Diff)) - +# define HP_TIMING_ACCUM(Sum, Diff) \ + do { \ + hp_timing_t __diff = (Diff) - GLRO(dl_hp_timing_overhead); \ + __asm__ __volatile__ ("lock; addq %1, %0" \ + : "=m" (Sum) : "r" (__diff), "m" (Sum)); \ + } while (0) #endif /* hp-timing.h */ |