diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-10-10 15:35:46 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-10-10 15:35:46 +0000 |
commit | 2d32c4f00084f68a390e8fa4291acb49e9c0df8e (patch) | |
tree | 00964019e9307917f730b8c6b817f0cb9496a167 /libc/ports/sysdeps | |
parent | 7dfcd4332472afda13e2ea9c0eaba15a08d8351e (diff) |
Merge changes between r20863 and r21108 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@21109 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/ports/sysdeps')
28 files changed, 128 insertions, 496 deletions
diff --git a/libc/ports/sysdeps/alpha/configure b/libc/ports/sysdeps/alpha/configure index d906524bd..9c03229df 100644 --- a/libc/ports/sysdeps/alpha/configure +++ b/libc/ports/sysdeps/alpha/configure @@ -4,3 +4,4 @@ # With required gcc+binutils, we can always access static and hidden # symbols in a position independent way. $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h + diff --git a/libc/ports/sysdeps/arm/configure b/libc/ports/sysdeps/arm/configure index 51fd72557..385f29590 100644 --- a/libc/ports/sysdeps/arm/configure +++ b/libc/ports/sysdeps/arm/configure @@ -1,102 +1,3 @@ - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/arm. diff --git a/libc/ports/sysdeps/arm/dl-machine.h b/libc/ports/sysdeps/arm/dl-machine.h index 343a83e98..3b25e0f0f 100644 --- a/libc/ports/sysdeps/arm/dl-machine.h +++ b/libc/ports/sysdeps/arm/dl-machine.h @@ -302,36 +302,56 @@ elf_machine_plt_value (struct link_map *map, const Elf32_Rel *reloc, #define ARCH_LA_PLTEXIT arm_gnu_pltexit #ifdef RESOLVE_MAP - -/* Deal with an out-of-range PC24 reloc. */ -auto Elf32_Addr -fix_bad_pc24 (Elf32_Addr *const reloc_addr, Elf32_Addr value) +/* Handle a PC24 reloc, including the out-of-range case. */ +auto void +relocate_pc24 (struct link_map *map, Elf32_Addr value, + Elf32_Addr *const reloc_addr, Elf32_Sword addend) { - static void *fix_page; - static unsigned int fix_offset; - static size_t pagesize; - Elf32_Word *fix_address; + Elf32_Addr new_value; + + /* Set NEW_VALUE based on V, and return true iff it overflows 24 bits. */ + inline bool set_new_value (Elf32_Addr v) + { + new_value = v + addend - (Elf32_Addr) reloc_addr; + Elf32_Addr topbits = new_value & 0xfe000000; + return topbits != 0xfe000000 && topbits != 0x00000000; + } - if (! fix_page) + if (set_new_value (value)) { - if (! pagesize) - pagesize = getpagesize (); - fix_page = mmap (NULL, pagesize, PROT_READ | PROT_WRITE | PROT_EXEC, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - if (! fix_page) - assert (! "could not map page for fixup"); - fix_offset = 0; + /* The PC-relative address doesn't fit in 24 bits! */ + + static void *fix_page; + static size_t fix_offset; + if (fix_page == NULL) + { + void *new_page = __mmap (NULL, GLRO(dl_pagesize), + PROT_READ | PROT_WRITE | PROT_EXEC, + MAP_PRIVATE | MAP_ANON, -1, 0); + if (new_page == MAP_FAILED) + _dl_signal_error (0, map->l_name, NULL, + "could not map page for fixup"); + fix_page = new_page; + assert (fix_offset == 0); + } + + Elf32_Word *fix_address = fix_page + fix_offset; + fix_address[0] = 0xe51ff004; /* ldr pc, [pc, #-4] */ + fix_address[1] = value; + + fix_offset += sizeof fix_address[0] * 2; + if (fix_offset >= GLRO(dl_pagesize)) + { + fix_page = NULL; + fix_offset = 0; + } + + if (set_new_value ((Elf32_Addr) fix_address)) + _dl_signal_error (0, map->l_name, NULL, + "R_ARM_PC24 relocation out of range"); } - fix_address = (Elf32_Word *)(fix_page + fix_offset); - fix_address[0] = 0xe51ff004; /* ldr pc, [pc, #-4] */ - fix_address[1] = value; - - fix_offset += 8; - if (fix_offset >= pagesize) - fix_page = NULL; - - return (Elf32_Addr)fix_address; + *reloc_addr = (*reloc_addr & 0xff000000) | ((new_value >> 2) & 0x00ffffff); } /* Perform the relocation specified by RELOC and SYM (which is fully resolved). @@ -473,30 +493,11 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc, } break; case R_ARM_PC24: - { - Elf32_Sword addend; - Elf32_Addr newvalue, topbits; - - addend = *reloc_addr & 0x00ffffff; - if (addend & 0x00800000) addend |= 0xff000000; - - newvalue = value - (Elf32_Addr)reloc_addr + (addend << 2); - topbits = newvalue & 0xfe000000; - if (topbits != 0xfe000000 && topbits != 0x00000000) - { - newvalue = fix_bad_pc24(reloc_addr, value) - - (Elf32_Addr)reloc_addr + (addend << 2); - topbits = newvalue & 0xfe000000; - if (topbits != 0xfe000000 && topbits != 0x00000000) - { - _dl_signal_error (0, map->l_name, NULL, - "R_ARM_PC24 relocation out of range"); - } - } - newvalue >>= 2; - value = (*reloc_addr & 0xff000000) | (newvalue & 0x00ffffff); - *reloc_addr = value; - } + relocate_pc24 (map, value, reloc_addr, + /* Sign-extend the 24-bit addend in the + instruction (which counts instructions), and + then shift it up two so as to count bytes. */ + (((Elf32_Sword) *reloc_addr << 8) >> 8) << 2); break; #if !defined RTLD_BOOTSTRAP case R_ARM_TLS_DTPMOD32: @@ -589,26 +590,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, *reloc_addr = value + reloc->r_addend; break; case R_ARM_PC24: - { - Elf32_Addr newvalue, topbits; - - newvalue = value + reloc->r_addend - (Elf32_Addr)reloc_addr; - topbits = newvalue & 0xfe000000; - if (topbits != 0xfe000000 && topbits != 0x00000000) - { - newvalue = fix_bad_pc24(reloc_addr, value) - - (Elf32_Addr)reloc_addr + (reloc->r_addend << 2); - topbits = newvalue & 0xfe000000; - if (topbits != 0xfe000000 && topbits != 0x00000000) - { - _dl_signal_error (0, map->l_name, NULL, - "R_ARM_PC24 relocation out of range"); - } - } - newvalue >>= 2; - value = (*reloc_addr & 0xff000000) | (newvalue & 0x00ffffff); - *reloc_addr = value; - } + relocate_pc24 (map, value, reloc_addr, reloc->r_addend); break; #if !defined RTLD_BOOTSTRAP case R_ARM_TLS_DTPMOD32: diff --git a/libc/ports/sysdeps/arm/dl-tlsdesc.h b/libc/ports/sysdeps/arm/dl-tlsdesc.h index 2b1131c55..97951c0da 100644 --- a/libc/ports/sysdeps/arm/dl-tlsdesc.h +++ b/libc/ports/sysdeps/arm/dl-tlsdesc.h @@ -20,12 +20,6 @@ #ifndef _ARM_DL_TLSDESC_H # define _ARM_DL_TLSDESC_H 1 -/* Use this to access DT_TLSDESC_PLT and DT_TLSDESC_GOT. */ -#ifndef ADDRIDX -# define ADDRIDX(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \ - + DT_EXTRANUM + DT_VALNUM + DT_ADDRTAGIDX (tag)) -#endif - /* Type used to represent a TLS descriptor in the GOT. */ struct tlsdesc { diff --git a/libc/ports/sysdeps/hppa/configure b/libc/ports/sysdeps/hppa/configure index c47fb6d0a..762b668f4 100644 --- a/libc/ports/sysdeps/hppa/configure +++ b/libc/ports/sysdeps/hppa/configure @@ -1,85 +1,3 @@ - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - # This file is generated from configure.in by Autoconf. DO NOT EDIT! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler line separator" >&5 diff --git a/libc/ports/sysdeps/ia64/configure b/libc/ports/sysdeps/ia64/configure index d73346006..e1fe62d8c 100644 --- a/libc/ports/sysdeps/ia64/configure +++ b/libc/ports/sysdeps/ia64/configure @@ -1,89 +1,3 @@ - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - # This file is generated from configure.in by Autoconf. DO NOT EDIT! # Local configure fragment for sysdeps/ia64. diff --git a/libc/ports/sysdeps/mips/dl-trampoline.c b/libc/ports/sysdeps/mips/dl-trampoline.c index 3454eb306..e4886cc9b 100644 --- a/libc/ports/sysdeps/mips/dl-trampoline.c +++ b/libc/ports/sysdeps/mips/dl-trampoline.c @@ -112,8 +112,6 @@ elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc) generated by the gnu linker. */ int _dl_mips_gnu_objects = 1; -#define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym)) - /* This is called from assembly stubs below which the compiler can't see. */ static ElfW(Addr) __dl_runtime_resolve (ElfW(Word), ElfW(Word), ElfW(Addr), ElfW(Addr)) diff --git a/libc/ports/sysdeps/mips/ieee754.h b/libc/ports/sysdeps/mips/ieee754/ieee754.h index 87dbf658e..87dbf658e 100644 --- a/libc/ports/sysdeps/mips/ieee754.h +++ b/libc/ports/sysdeps/mips/ieee754/ieee754.h diff --git a/libc/ports/sysdeps/mips/init-first.c b/libc/ports/sysdeps/mips/init-first.c deleted file mode 100644 index 6a5e7caf0..000000000 --- a/libc/ports/sysdeps/mips/init-first.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Initialization code run first thing by the ELF startup code. For mips/Unix. - Copyright (C) 1996, 1997, 2010 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, see - <http://www.gnu.org/licenses/>. */ - -#include <unistd.h> - -extern void __libc_init (int, char **, char **); -extern void __libc_global_ctors (void); - - -static void -init (int *data) -{ - int argc = *data; - char **argv = (void *) (data + 1); - char **envp = &argv[argc + 1]; - - __environ = envp; - __libc_init (argc, argv, envp); -} - -#ifdef SHARED -/* This function is called to initialize the shared C library. - It is called just before the user _start code from mips/elf/start.S, - with the stack set up as that code gets it. */ - -/* NOTE! The linker notices the magical name `_init' and sets the DT_INIT - pointer in the dynamic section based solely on that. It is convention - for this function to be in the `.init' section, but the symbol name is - the only thing that really matters!! */ -/*void _init (int argc, ...) __attribute__ ((unused, section (".init")));*/ - -void -_init (int argc, ...) -{ - init (&argc); - -#ifndef NO_CTORS_DTORS_SECTIONS - __libc_global_ctors (); -#endif -} -#endif - - -void -__libc_init_first (int argc __attribute__ ((unused)), ...) -{ -#ifndef SHARED - init (&argc); -#endif -} diff --git a/libc/ports/sysdeps/mips/mips32/Implies b/libc/ports/sysdeps/mips/mips32/Implies index fab98d731..6473f2517 100644 --- a/libc/ports/sysdeps/mips/mips32/Implies +++ b/libc/ports/sysdeps/mips/mips32/Implies @@ -1,2 +1,3 @@ +mips/ieee754 mips wordsize-32 diff --git a/libc/ports/sysdeps/mips/mips64/Implies b/libc/ports/sysdeps/mips/mips64/Implies index 8c18cb303..826ff1541 100644 --- a/libc/ports/sysdeps/mips/mips64/Implies +++ b/libc/ports/sysdeps/mips/mips64/Implies @@ -1,3 +1,4 @@ # MIPS uses IEEE 754 floating point. +mips/ieee754 ieee754/flt-32 ieee754/dbl-64 diff --git a/libc/ports/sysdeps/mips/mips64/n32/Implies b/libc/ports/sysdeps/mips/mips64/n32/Implies index bed8f14c3..9ab2f3261 100644 --- a/libc/ports/sysdeps/mips/mips64/n32/Implies +++ b/libc/ports/sysdeps/mips/mips64/n32/Implies @@ -1,3 +1,4 @@ +mips/ieee754 ieee754/ldbl-128 mips/mips64/soft-fp mips/mips64 diff --git a/libc/ports/sysdeps/mips/mips64/n64/Implies b/libc/ports/sysdeps/mips/mips64/n64/Implies index 214b85c77..de23ed1c3 100644 --- a/libc/ports/sysdeps/mips/mips64/n64/Implies +++ b/libc/ports/sysdeps/mips/mips64/n64/Implies @@ -1,3 +1,4 @@ +mips/ieee754 ieee754/ldbl-128 mips/mips64/soft-fp mips/mips64 diff --git a/libc/ports/sysdeps/unix/alpha/sysdep.h b/libc/ports/sysdeps/unix/alpha/sysdep.h index 4ee0746ac..75c06c9cf 100644 --- a/libc/ports/sysdeps/unix/alpha/sysdep.h +++ b/libc/ports/sysdeps/unix/alpha/sysdep.h @@ -52,13 +52,20 @@ #define END(sym) .end sym #ifdef PROF +# define PSEUDO_PROF \ + .set noat; \ + lda AT, _mcount; \ + jsr AT, (AT), _mcount; \ + .set at +#else +# define PSEUDO_PROF +#endif + +#ifdef PROF # define PSEUDO_PROLOGUE \ .frame sp, 0, ra; \ ldgp gp,0(pv); \ - .set noat; \ - lda AT,_mcount; \ - jsr AT,(AT),_mcount; \ - .set at; \ + PSEUDO_PROF; \ .prologue 1 #elif defined PIC # define PSEUDO_PROLOGUE \ @@ -80,16 +87,21 @@ #if RTLD_PRIVATE_ERRNO # define SYSCALL_ERROR_LABEL $syscall_error # define SYSCALL_ERROR_HANDLER \ +$syscall_error: \ stl v0, rtld_errno(gp) !gprel; \ lda v0, -1; \ ret +# define SYSCALL_ERROR_FALLTHRU #elif defined(PIC) -# define SYSCALL_ERROR_LABEL __syscall_error !samegp +# define SYSCALL_ERROR_LABEL __syscall_error !samegp # define SYSCALL_ERROR_HANDLER +# define SYSCALL_ERROR_FALLTHRU br SYSCALL_ERROR_LABEL #else -# define SYSCALL_ERROR_LABEL $syscall_error -# define SYSCALL_ERROR_HANDLER \ - jmp $31, __syscall_error +# define SYSCALL_ERROR_LABEL $syscall_error +# define SYSCALL_ERROR_HANDLER \ +$syscall_error: \ + jmp $31, __syscall_error +# define SYSCALL_ERROR_FALLTHRU #endif /* RTLD_PRIVATE_ERRNO */ /* Overridden by specific syscalls. */ @@ -108,14 +120,9 @@ __LABEL(name) \ bne a3, SYSCALL_ERROR_LABEL #undef PSEUDO_END -#if defined(PIC) && !RTLD_PRIVATE_ERRNO -# define PSEUDO_END(sym) END(sym) -#else -# define PSEUDO_END(sym) \ -$syscall_error: \ +#define PSEUDO_END(sym) \ SYSCALL_ERROR_HANDLER; \ END(sym) -#endif #define PSEUDO_NOERRNO(name, syscall_name, args) \ .globl name; \ diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h index 31258e420..5ab9ac43a 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h @@ -50,7 +50,6 @@ #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __S64_TYPE #define __DADDR_T_TYPE __S32_TYPE -#define __SWBLK_T_TYPE __SLONGWORD_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE #define __TIMER_T_TYPE void * diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/clone.S b/libc/ports/sysdeps/unix/sysv/linux/alpha/clone.S index 1c6c8d6b7..b92b6c2e7 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/clone.S +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/clone.S @@ -35,89 +35,84 @@ we don't bother checking FLAGS. */ .text -ENTRY(__clone) + .align 4 + .globl __clone + .ent __clone + .usepv __clone, USEPV_PROF + + cfi_startproc +__clone: #ifdef PROF ldgp gp,0(pv) - .set noat lda AT, _mcount jsr AT, (AT), _mcount - .set at - .prologue 1 -#else - .prologue 0 #endif /* Sanity check arguments. */ - ldiq v0,EINVAL - beq a0,$error /* no NULL function pointers */ - beq a1,$error /* no NULL stack pointers */ + ldiq v0, EINVAL + beq a0, SYSCALL_ERROR_LABEL /* no NULL function pointers */ + beq a1, SYSCALL_ERROR_LABEL /* no NULL stack pointers */ /* Save the fn ptr and arg on the new stack. */ - subq a1,32,a1 - stq a0,0(a1) - stq a3,8(a1) + subq a1, 32, a1 + stq a0, 0(a1) + stq a3, 8(a1) #ifdef RESET_PID - stq a2,16(a1) + stq a2, 16(a1) #endif /* The syscall is of the form clone(flags, usp, ptid, ctid, tls). Shift the flags, ptid, ctid, tls arguments into place; the child_stack argument is already correct. */ - mov a2,a0 - mov a4,a2 - ldq a3,0(sp) - mov a5,a4 + mov a2, a0 + mov a4, a2 + ldq a3, 0(sp) + mov a5, a4 /* Do the system call. */ - ldiq v0,__NR_clone + ldiq v0, __NR_clone call_pal PAL_callsys - bne a3,$error - beq v0,thread_start + bne a3, SYSCALL_ERROR_LABEL + beq v0, thread_start /* Successful return from the parent. */ ret - /* Something bad happened -- no child created. */ -$error: -#ifndef PROF - br gp,1f -1: ldgp gp,0(gp) -#endif - SYSCALL_ERROR_HANDLER - - END(__clone) +PSEUDO_END(__clone) + cfi_endproc /* Load up the arguments to the function. Put this block of code in its own function so that we can terminate the stack trace with our debug info. */ .ent thread_start + cfi_startproc thread_start: - .frame fp,0,fp,0 mov 0, fp - .prologue 0 + cfi_def_cfa_register(fp) + cfi_undefined(ra) #ifdef RESET_PID /* Check and see if we need to reset the PID. */ - ldq t0,16(sp) - lda t1,CLONE_THREAD - and t0,t1,t2 - beq t2,2f + ldq t0, 16(sp) + lda t1, CLONE_THREAD + and t0, t1, t2 + beq t2, 2f 1: #endif /* Load up the arguments. */ - ldq pv,0(sp) - ldq a0,8(sp) - addq sp,32,sp + ldq pv, 0(sp) + ldq a0, 8(sp) + addq sp, 32, sp /* Call the user's function. */ - jsr ra,(pv) - ldgp gp,0(ra) + jsr ra, (pv) + ldgp gp, 0(ra) /* Call _exit rather than doing it inline for breakpoint purposes. */ - mov v0,a0 + mov v0, a0 #ifdef PIC bsr ra, HIDDEN_JUMPTARGET(_exit) !samegp #else @@ -142,7 +137,7 @@ thread_start: stl v0, TID_OFFSET(s0) br 1b #endif - + cfi_endproc .end thread_start weak_alias (__clone, clone) diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h index ac364dae1..0ef2e7fd3 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/lowlevellock.h @@ -259,7 +259,7 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime, #define LLL_LOCK_INITIALIZER_LOCKED (1) -/* The kernel notifies a process which uses CLONE_CLEARTID via futex +/* The kernel notifies a process which uses CLONE_CHILD_CLEARTID via futex wakeup when the clone terminates. The memory location contains the thread ID while the clone is running and is reset to zero afterwards. */ diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cancel.h b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cancel.h index 04c7af472..e6795d98f 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cancel.h +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/sysdep-cancel.h @@ -23,16 +23,6 @@ #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt -# ifdef PROF -# define PSEUDO_PROF \ - .set noat; \ - lda AT, _mcount; \ - jsr AT, (AT), _mcount; \ - .set at -# else -# define PSEUDO_PROF -# endif - /* ??? Assumes that nothing comes between PSEUDO and PSEUDO_END besides "ret". */ @@ -88,7 +78,7 @@ __LABEL($multi_error) \ addq sp, 64, sp; \ cfi_restore(ra); \ cfi_def_cfa_offset(0); \ -__LABEL($syscall_error) \ + SYSCALL_ERROR_FALLTHRU; \ SYSCALL_ERROR_HANDLER; \ cfi_endproc; \ .previous diff --git a/libc/ports/sysdeps/unix/sysv/linux/alpha/syscall.S b/libc/ports/sysdeps/unix/sysv/linux/alpha/syscall.S index 830b10acb..5cec3800e 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/alpha/syscall.S +++ b/libc/ports/sysdeps/unix/sysv/linux/alpha/syscall.S @@ -62,16 +62,9 @@ LEAF(__syscall, 0) ldq a5,0(sp) /* arg6 -> a5 */ call_pal PAL_callsys /* Invoke system call */ - bne a3, $error + bne a3, SYSCALL_ERROR_LABEL ret -$error: -#ifndef PROF - br gp, 2f -2: ldgp gp, 0(gp) -#endif - SYSCALL_ERROR_HANDLER - -END(__syscall) +PSEUDO_END(__syscall) weak_alias (__syscall, syscall) diff --git a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h index b9fa69ce3..5811361e3 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h +++ b/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h @@ -256,7 +256,7 @@ extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *, 1 - taken by one user >1 - taken by more users */ -/* The kernel notifies a process which uses CLONE_CLEARTID via futex +/* The kernel notifies a process which uses CLONE_CHILD_CLEARTID via futex wakeup when the clone terminates. The memory location contains the thread ID while the clone is running and is reset to zero afterwards. */ diff --git a/libc/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/libc/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h index d7d2a5c10..d5799d185 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h +++ b/libc/ports/sysdeps/unix/sysv/linux/generic/bits/typesizes.h @@ -52,7 +52,6 @@ #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE -#define __SWBLK_T_TYPE __SLONGWORD_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE #define __TIMER_T_TYPE void * diff --git a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h index 6d4b13517..ad601c683 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h +++ b/libc/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h @@ -319,7 +319,7 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime, extern int lll_unlock_wake_cb (lll_lock_t *__futex) attribute_hidden; -/* The kernel notifies a process which uses CLONE_CLEARTID via futex +/* The kernel notifies a process which uses CLONE_CHILD_CLEARTID via futex wakeup when the clone terminates. The memory location contains the thread ID while the clone is running and is reset to zero afterwards. */ diff --git a/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h index 24ed47e22..e36ff2653 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h +++ b/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/lowlevellock.h @@ -267,7 +267,7 @@ extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *, #define LLL_LOCK_INITIALIZER (0) #define LLL_LOCK_INITIALIZER_LOCKED (1) -/* The kernel notifies a process with uses CLONE_CLEARTID via futex +/* The kernel notifies a process which uses CLONE_CHILD_CLEARTID via futex wakeup when the clone terminates. The memory location contains the thread ID while the clone is running and is reset to zero afterwards. */ diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/init-first.c b/libc/ports/sysdeps/unix/sysv/linux/m68k/init-first.c index ec311ec42..713ab86b1 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/m68k/init-first.c +++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/init-first.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2010 Free Software Foundation, Inc. +/* Initialization code run first thing by the ELF startup code. Linux/m68k. + Copyright (C) 2010-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Maxim Kuvyrkov <maxim@codesourcery.com>, 2010. @@ -70,4 +71,4 @@ _libc_vdso_platform_setup (void) #endif /* SHARED */ -#include <sysdeps/unix/sysv/linux/init-first.c> +#include <csu/init-first.c> diff --git a/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h index fed152ae3..4dbed8d37 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h +++ b/libc/ports/sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h @@ -254,7 +254,7 @@ extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *, 1 - taken by one user >1 - taken by more users */ -/* The kernel notifies a process which uses CLONE_CLEARTID via futex +/* The kernel notifies a process which uses CLONE_CHILD_CLEARTID via futex wakeup when the clone terminates. The memory location contains the thread ID while the clone is running and is reset to zero afterwards. */ diff --git a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h index d368ae1b6..9c1701167 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h +++ b/libc/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h @@ -268,7 +268,7 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime, 1 - taken by one user >1 - taken by more users */ -/* The kernel notifies a process which uses CLONE_CLEARTID via futex +/* The kernel notifies a process which uses CLONE_CHILD_CLEARTID via futex wakeup when the clone terminates. The memory location contains the thread ID while the clone is running and is reset to zero afterwards. */ diff --git a/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist b/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist index 11ad6a525..481162e99 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist +++ b/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist @@ -1775,6 +1775,7 @@ GLIBC_2.16 GLIBC_2.17 GLIBC_2.17 A secure_getenv F + __ppc_get_timebase_freq F GLIBC_2.2 GLIBC_2.2 A _IO_adjust_wcolumn F diff --git a/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h b/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h index 8690c7be4..0e0d48ed0 100644 --- a/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h +++ b/libc/ports/sysdeps/unix/sysv/linux/tile/nptl/lowlevellock.h @@ -255,7 +255,7 @@ __lll_robust_timedlock (int *futex, const struct timespec *abstime, #define LLL_LOCK_INITIALIZER_LOCKED (1) -/* The kernel notifies a process which uses CLONE_CLEARTID via futex +/* The kernel notifies a process which uses CLONE_CHILD_CLEARTID via futex wakeup when the clone terminates. The memory location contains the thread ID while the clone is running and is reset to zero afterwards. */ |