1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Move arm from ports to libc.

I've moved the ARM port from ports to the main sysdeps hierarchy.
Beyond the README update, the move of the files was simply

git mv ports/sysdeps/arm sysdeps/arm
git mv ports/sysdeps/unix/arm sysdeps/unix/arm
git mv ports/sysdeps/unix/sysv/linux/arm sysdeps/unix/sysv/linux/arm

and in addition to the ChangeLog entries here, I put a note at the top
of ports/ChangeLog.arm similar to that at the top of
ChangeLog.powerpc.  There is deliberately no NEWS change, as I think
it makes the most sense to put in a general note above all ports
having moved if we can achieve that for 2.20.

Tested that disassembly of installed shared libraries for arm is the
same before and after this patch, except for data (not instructions)
in ld.so (there are assertions in sysdeps/arm/dl-machine.h, and the
path by which that file is found, and so by which it appears in the
assertion message, changes as a result of the move).

	* sysdeps/arm: Move directory from ports/sysdeps/arm.
	* sysdeps/unix/arm: Move directory from ports/sysdeps/unix/arm.
	* sysdeps/unix/sysv/linux/arm: Move directory from
	ports/sysdeps/unix/sysv/linux/arm.
	* README: Update listing for arm-*-linux-gnueabi.

ports/ChangeLog.arm:
	* sysdeps/arm: Move directory to ../sysdeps/arm.
	* sysdeps/unix/arm: Move directory to ../sysdeps.arm.
	* sysdeps/unix/sysv/linux/arm: Move directory to
	../sysdeps/unix/sysv/linux/arm.
This commit is contained in:
Joseph Myers
2014-02-08 01:49:39 +00:00
parent 852fa2dd3a
commit c6bfe5c4d7
269 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,85 @@
ifeq ($(subdir),csu)
# In order for unwinding to fail when it falls out of main, we need a
# cantunwind marker. There's one in start.S. To make sure we reach it, add
# unwind tables for __libc_start_main.
CFLAGS-libc-start.c += -fexceptions
sysdep_routines += aeabi_read_tp libc-aeabi_read_tp
static-only-routines += aeabi_read_tp
shared-only-routines += libc-aeabi_read_tp
endif
ifeq ($(subdir),elf)
sysdep-rtld-routines += aeabi_read_tp libc-do-syscall
endif
ifeq ($(subdir),misc)
sysdep_routines += ioperm
sysdep_headers += sys/elf.h sys/io.h
endif
ifeq ($(subdir),signal)
sysdep_routines += sigrestorer
endif
ifeq ($(subdir),resource)
sysdep_routines += oldgetrlimit64
endif
ifeq ($(subdir),stdlib)
gen-as-const-headers += ucontext_i.sym
endif
# Add a syscall function to each library that needs one.
ifeq ($(subdir),crypt)
libcrypt-sysdep_routines += libc-do-syscall
endif
ifeq ($(subdir),rt)
librt-sysdep_routines += libc-do-syscall
librt-shared-only-routines += libc-do-syscall
endif
ifeq ($(subdir),nptl)
libpthread-sysdep_routines += libc-do-syscall
libpthread-shared-only-routines += libc-do-syscall
endif
ifeq ($(subdir),resolv)
libanl-sysdep_routines += libc-do-syscall
libanl-shared-only-routines += libc-do-syscall
endif
ifeq ($(subdir),csu)
sysdep_routines += libc-do-syscall
endif
ifeq ($(subdir),nscd)
nscd-modules += libc-do-syscall
endif
ifeq ($(subdir),nss)
libnss_db-sysdep_routines += libc-do-syscall
libnss_db-shared-only-routines += libc-do-syscall
endif
ifeq ($(subdir),posix)
LDFLAGS-tst-rfc3484 += $(common-objpfx)csu/libc-do-syscall.o
LDFLAGS-tst-rfc3484-2 += $(common-objpfx)csu/libc-do-syscall.o
LDFLAGS-tst-rfc3484-3 += $(common-objpfx)csu/libc-do-syscall.o
endif
abi-variants := soft hard
ifeq (,$(filter $(default-abi),$(abi-variants)))
Unknown ABI, must be one of $(abi-variants)
endif
abi-includes :=
abi-soft-options := -U__ARM_PCS_VFP
abi-soft-condition := !defined __ARM_PCS_VFP
abi-soft-ld-soname := ld-linux.so.3
abi-hard-options := -D__ARM_PCS_VFP
abi-hard-condition := defined __ARM_PCS_VFP
abi-hard-ld-soname := ld-linux-armhf.so.3

View File

@ -0,0 +1,40 @@
libc {
GLIBC_2.0 {
# Exception handling support functions from libgcc
__register_frame; __register_frame_table; __deregister_frame;
__frame_state_for; __register_frame_info_table;
}
GLIBC_2.1 {
ioperm; iopl;
inb; inw; inl;
outb; outw; outl;
}
GLIBC_2.2 {
# functions used in other libraries
__xstat64; __fxstat64; __lxstat64;
# a*
alphasort64;
# g*
glob64;
# New rlimit interface
getrlimit; setrlimit; getrlimit64;
# r*
readdir64; readdir64_r;
# s*
scandir64;
# v*
versionsort64;
}
GLIBC_2.3.3 {
posix_fadvise64; posix_fallocate64;
}
GLIBC_2.11 {
fallocate64;
}
}

View File

@ -0,0 +1,90 @@
/* Copyright (C) 2009-2014 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 <sysdep.h>
.section .rodata.str1.1,"aMS",%progbits,1
.type longjmp_msg,%object
longjmp_msg:
.string "longjmp causes uninitialized stack frame"
.size longjmp_msg, .-longjmp_msg
.text
#define __longjmp ____longjmp_chk
#ifdef PIC
# define CALL_FAIL \
ldr sl, .L_GOT; \
cfi_undefined (sl); \
.L_GOT_OFF: \
add sl, pc, sl; \
ldr r0, .Lstr; \
add r0, sl, r0; \
B PLTJMP(HIDDEN_JUMPTARGET(__fortify_fail)); \
.L_GOT: \
.word _GLOBAL_OFFSET_TABLE_-(.L_GOT_OFF+8); \
.Lstr: \
.word longjmp_msg(GOTOFF);
#else
# define CALL_FAIL \
ldr r0, .Lstr; \
B HIDDEN_JUMPTARGET(__fortify_fail); \
.Lstr: \
.word longjmp_msg;
#endif
#define CHECK_SP(reg) \
cfi_remember_state; \
cmp sp, reg; \
bls .Lok; \
push { r7 }; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (r7, 0); \
mov r5, r0; \
cfi_undefined (r5); \
mov r7, #SYS_ify(sigaltstack); \
mov r0, #0; \
sub sp, sp, #12; /* == sizeof (stack_t) */ \
cfi_adjust_cfa_offset (12); \
cfi_remember_state; \
mov r1, sp; \
swi #0; \
cmp r0, #0; \
bne .Lok2; \
ldr r1, [sp, #4]; \
tst r1, #1; \
beq .Lfail; \
ldr r2, [sp, #0]; \
ldr r3, [sp, #8]; \
add r2, r2, r3; \
sub r2, r2, reg; \
cmp r2, r3; \
bhi .Lok2; \
.Lfail: \
add sp, sp, #12; \
cfi_adjust_cfa_offset (-12); \
pop { r7 }; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (r7); \
CALL_FAIL \
cfi_restore_state; \
.Lok2: \
mov r0, r5; \
cfi_restore_state; \
.Lok:
#include <__longjmp.S>

View File

@ -0,0 +1,55 @@
/* Copyright (C) 2005-2014 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.
In addition to the permissions in the GNU Lesser General Public
License, the Free Software Foundation gives you unlimited
permission to link the compiled version of this file with other
programs, and to distribute those programs without any restriction
coming from the use of this file. (The GNU Lesser General Public
License restrictions do apply in other respects; for example, they
cover modification of the file, and distribution when not linked
into another program.)
Note that people who make modified versions of this file are not
obligated to grant this special exception for their modified
versions; it is their choice whether to do so. The GNU Lesser
General Public License gives permission to release a modified
version without this exception; this exception also makes it
possible to release a modified version which carries forward this
exception.
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 <sysdep.h>
/* GCC will emit calls to this routine under -mtp=soft. Linux has an
equivalent helper function (which clobbers fewer registers than
a normal function call) in a high page of memory; tail call to the
helper. */
.hidden __aeabi_read_tp
ENTRY (__aeabi_read_tp)
#ifdef ARCH_HAS_HARD_TP
mrc p15, 0, r0, c13, c0, 3
bx lr
#elif defined(__thumb2__)
movw r0, #0x0fe0
movt r0, #0xffff
bx r0
#else
mov r0, #0xffff0fff
sub pc, r0, #31
#endif
END (__aeabi_read_tp)

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/alphasort64.c>

View File

@ -0,0 +1,30 @@
/* Macros to test for CPU features on ARM. Linux version.
Copyright (C) 2012-2014 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/>. */
#ifndef _LINUX_ARM_FEATURES_H
#define _LINUX_ARM_FEATURES_H 1
#ifndef __ASSEMBLER__
# include <ldsodefs.h>
# define ARM_HAVE_VFP (GLRO (dl_hwcap) & HWCAP_ARM_VFP)
#endif
#include_next <arm-features.h>
#endif /* arm-features.h */

View File

@ -0,0 +1,107 @@
/* Atomic operations. ARM/Linux version.
Copyright (C) 2002-2014 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 <stdint.h>
/* If the compiler doesn't provide a primitive, we'll use this macro
to get assistance from the kernel. */
#ifdef __thumb2__
# define __arm_assisted_full_barrier() \
__asm__ __volatile__ \
("movw\tip, #0x0fa0\n\t" \
"movt\tip, #0xffff\n\t" \
"blx\tip" \
: : : "ip", "lr", "cc", "memory");
#else
# define __arm_assisted_full_barrier() \
__asm__ __volatile__ \
("mov\tip, #0xffff0fff\n\t" \
"mov\tlr, pc\n\t" \
"add\tpc, ip, #(0xffff0fa0 - 0xffff0fff)" \
: : : "ip", "lr", "cc", "memory");
#endif
/* Atomic compare and exchange. This sequence relies on the kernel to
provide a compare and exchange operation which is atomic on the
current architecture, either via cleverness on pre-ARMv6 or via
ldrex / strex on ARMv6.
It doesn't matter what register is used for a_oldval2, but we must
specify one to work around GCC PR rtl-optimization/21223. Otherwise
it may cause a_oldval or a_tmp to be moved to a different register.
We use the union trick rather than simply using __typeof (...) in the
declarations of A_OLDVAL et al because when NEWVAL or OLDVAL is of the
form *PTR and PTR has a 'volatile ... *' type, then __typeof (*PTR) has
a 'volatile ...' type and this triggers -Wvolatile-register-var to
complain about 'register volatile ... asm ("reg")'. */
#ifdef __thumb2__
/* Thumb-2 has ldrex/strex. However it does not have barrier instructions,
so we still need to use the kernel helper. */
# define __arm_assisted_compare_and_exchange_val_32_acq(mem, newval, oldval) \
({ union { __typeof (oldval) a; uint32_t v; } oldval_arg = { .a = (oldval) };\
union { __typeof (newval) a; uint32_t v; } newval_arg = { .a = (newval) };\
register uint32_t a_oldval asm ("r0"); \
register uint32_t a_newval asm ("r1") = newval_arg.v; \
register __typeof (mem) a_ptr asm ("r2") = (mem); \
register uint32_t a_tmp asm ("r3"); \
register uint32_t a_oldval2 asm ("r4") = oldval_arg.v; \
__asm__ __volatile__ \
("0:\tldr\t%[tmp],[%[ptr]]\n\t" \
"cmp\t%[tmp], %[old2]\n\t" \
"bne\t1f\n\t" \
"mov\t%[old], %[old2]\n\t" \
"movw\t%[tmp], #0x0fc0\n\t" \
"movt\t%[tmp], #0xffff\n\t" \
"blx\t%[tmp]\n\t" \
"bcc\t0b\n\t" \
"mov\t%[tmp], %[old2]\n\t" \
"1:" \
: [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp) \
: [new] "r" (a_newval), [ptr] "r" (a_ptr), \
[old2] "r" (a_oldval2) \
: "ip", "lr", "cc", "memory"); \
(__typeof (oldval)) a_tmp; })
#else
# define __arm_assisted_compare_and_exchange_val_32_acq(mem, newval, oldval) \
({ union { __typeof (oldval) a; uint32_t v; } oldval_arg = { .a = (oldval) };\
union { __typeof (newval) a; uint32_t v; } newval_arg = { .a = (newval) };\
register uint32_t a_oldval asm ("r0"); \
register uint32_t a_newval asm ("r1") = newval_arg.v; \
register __typeof (mem) a_ptr asm ("r2") = (mem); \
register uint32_t a_tmp asm ("r3"); \
register uint32_t a_oldval2 asm ("r4") = oldval_arg.v; \
__asm__ __volatile__ \
("0:\tldr\t%[tmp],[%[ptr]]\n\t" \
"cmp\t%[tmp], %[old2]\n\t" \
"bne\t1f\n\t" \
"mov\t%[old], %[old2]\n\t" \
"mov\t%[tmp], #0xffff0fff\n\t" \
"mov\tlr, pc\n\t" \
"add\tpc, %[tmp], #(0xffff0fc0 - 0xffff0fff)\n\t" \
"bcc\t0b\n\t" \
"mov\t%[tmp], %[old2]\n\t" \
"1:" \
: [old] "=&r" (a_oldval), [tmp] "=&r" (a_tmp) \
: [new] "r" (a_newval), [ptr] "r" (a_ptr), \
[old2] "r" (a_oldval2) \
: "ip", "lr", "cc", "memory"); \
(__typeof (oldval)) a_tmp; })
#endif
#include <sysdeps/arm/bits/atomic.h>

View File

@ -0,0 +1,54 @@
/* O_*, F_*, FD_* bit values for Linux.
Copyright (C) 1995-2014 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/>. */
#ifndef _FCNTL_H
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
#endif
#define __O_DIRECTORY 040000 /* Must be a directory. */
#define __O_NOFOLLOW 0100000 /* Do not follow links. */
#define __O_DIRECT 0200000 /* Direct disk access. */
#define __O_LARGEFILE 0400000
struct flock
{
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
#ifndef __USE_FILE_OFFSET64
__off_t l_start; /* Offset where the lock begins. */
__off_t l_len; /* Size of the locked area; zero means until EOF. */
#else
__off64_t l_start; /* Offset where the lock begins. */
__off64_t l_len; /* Size of the locked area; zero means until EOF. */
#endif
__pid_t l_pid; /* Process holding the lock. */
};
#ifdef __USE_LARGEFILE64
struct flock64
{
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
__off64_t l_start; /* Offset where the lock begins. */
__off64_t l_len; /* Size of the locked area; zero means until EOF. */
__pid_t l_pid; /* Process holding the lock. */
};
#endif
/* Include generic Linux declarations. */
#include <bits/fcntl-linux.h>

View File

@ -0,0 +1,42 @@
/* Defines for bits in AT_HWCAP. ARM Linux version.
Copyright (C) 2012-2014 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/>. */
#ifndef _SYS_AUXV_H
# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
#endif
/* The following must match the kernel's <asm/hwcap.h>. */
#define HWCAP_ARM_SWP 1
#define HWCAP_ARM_HALF 2
#define HWCAP_ARM_THUMB 4
#define HWCAP_ARM_26BIT 8
#define HWCAP_ARM_FAST_MULT 16
#define HWCAP_ARM_FPA 32
#define HWCAP_ARM_VFP 64
#define HWCAP_ARM_EDSP 128
#define HWCAP_ARM_JAVA 256
#define HWCAP_ARM_IWMMXT 512
#define HWCAP_ARM_CRUNCH 1024
#define HWCAP_ARM_THUMBEE 2048
#define HWCAP_ARM_NEON 4096
#define HWCAP_ARM_VFPv3 8192
#define HWCAP_ARM_VFPv3D16 16384
#define HWCAP_ARM_TLS 32768
#define HWCAP_ARM_VFPv4 65536
#define HWCAP_ARM_IDIVA 131072
#define HWCAP_ARM_IDIVT 262144

View File

@ -0,0 +1,40 @@
/* Definitions for POSIX memory map interface. Linux/ARM version.
Copyright (C) 1997-2014 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/>. */
#ifndef _SYS_MMAN_H
# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
#endif
/* The following definitions basically come from the kernel headers.
But the kernel header is not namespace clean. */
/* These are Linux-specific. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
# define MAP_DENYWRITE 0x00800 /* ETXTBSY */
# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
# define MAP_LOCKED 0x02000 /* Lock the mapping. */
# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#endif
/* Include generic Linux declarations. */
#include <bits/mman-linux.h>

View File

@ -0,0 +1,103 @@
/* Copyright (C) 1995-2014 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/>. */
#ifndef _SYS_SHM_H
# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
#endif
#include <bits/types.h>
/* Permission flag for shmget. */
#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
/* Flags for `shmat'. */
#define SHM_RDONLY 010000 /* attach read-only else read-write */
#define SHM_RND 020000 /* round attach address to SHMLBA */
#define SHM_REMAP 040000 /* take-over region on attach */
#define SHM_EXEC 0100000 /* execution access */
/* Commands for `shmctl'. */
#define SHM_LOCK 11 /* lock segment (root only) */
#define SHM_UNLOCK 12 /* unlock segment (root only) */
__BEGIN_DECLS
/* Segment low boundary address multiple. */
#define SHMLBA (__getpagesize () << 2)
extern int __getpagesize (void) __THROW __attribute__ ((__const__));
/* Type to count number of attaches. */
typedef unsigned long int shmatt_t;
/* Data structure describing a shared memory segment. */
struct shmid_ds
{
struct ipc_perm shm_perm; /* operation permission struct */
size_t shm_segsz; /* size of segment in bytes */
__time_t shm_atime; /* time of last shmat() */
unsigned long int __glibc_reserved1;
__time_t shm_dtime; /* time of last shmdt() */
unsigned long int __glibc_reserved2;
__time_t shm_ctime; /* time of last change by shmctl() */
unsigned long int __glibc_reserved3;
__pid_t shm_cpid; /* pid of creator */
__pid_t shm_lpid; /* pid of last shmop */
shmatt_t shm_nattch; /* number of current attaches */
unsigned long int __glibc_reserved4;
unsigned long int __glibc_reserved5;
};
#ifdef __USE_MISC
/* ipcs ctl commands */
# define SHM_STAT 13
# define SHM_INFO 14
/* shm_mode upper byte flags */
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
# define SHM_LOCKED 02000 /* segment will not be swapped */
# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
# define SHM_NORESERVE 010000 /* don't check for reservations */
struct shminfo
{
unsigned long int shmmax;
unsigned long int shmmin;
unsigned long int shmmni;
unsigned long int shmseg;
unsigned long int shmall;
unsigned long int __glibc_reserved1;
unsigned long int __glibc_reserved2;
unsigned long int __glibc_reserved3;
unsigned long int __glibc_reserved4;
};
struct shm_info
{
int used_ids;
unsigned long int shm_tot; /* total allocated shm */
unsigned long int shm_rss; /* total resident shm */
unsigned long int shm_swp; /* total swapped shm */
unsigned long int swap_attempts;
unsigned long int swap_successes;
};
#endif /* __USE_MISC */
__END_DECLS

View File

@ -0,0 +1,41 @@
/* brk system call for Linux/ARM.
Copyright (C) 1995-2014 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 <errno.h>
#include <unistd.h>
#include <sysdep.h>
/* This must be initialized data because commons can't have aliases. */
void *__curbrk = 0;
int
__brk (void *addr)
{
void *newbrk;
__curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr);
if (newbrk < addr)
{
__set_errno (ENOMEM);
return -1;
}
return 0;
}
weak_alias (__brk, brk)

View File

@ -0,0 +1,99 @@
/* Copyright (C) 1996-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Pat Beirne <patb@corelcomputer.com>
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/>. */
/* clone() is even more special than fork() as it mucks with stacks
and invokes a function in the right context after its all over. */
#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
#define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg,
pid_t *ptid, struct user_desc *tls, pid_t *ctid); */
.text
ENTRY(__clone)
@ sanity check args
cmp r0, #0
ite ne
cmpne r1, #0
moveq r0, #-EINVAL
beq PLTJMP(syscall_error)
@ insert the args onto the new stack
str r3, [r1, #-4]!
str r0, [r1, #-4]!
@ do the system call
@ get flags
mov r0, r2
#ifdef RESET_PID
mov ip, r2
#endif
@ new sp is already in r1
push {r4, r7}
cfi_adjust_cfa_offset (8)
cfi_rel_offset (r4, 0)
cfi_rel_offset (r7, 4)
ldr r2, [sp, #8]
ldr r3, [sp, #12]
ldr r4, [sp, #16]
ldr r7, =SYS_ify(clone)
swi 0x0
cfi_endproc
cmp r0, #0
beq 1f
pop {r4, r7}
blt PLTJMP(C_SYMBOL_NAME(__syscall_error))
RETINSTR(, lr)
cfi_startproc
PSEUDO_END (__clone)
1:
.fnstart
.cantunwind
#ifdef RESET_PID
tst ip, #CLONE_THREAD
bne 3f
GET_TLS (lr)
mov r1, r0
tst ip, #CLONE_VM
ldr r7, =SYS_ify(getpid)
ite ne
movne r0, #-1
swieq 0x0
NEGOFF_ADJ_BASE (r1, TID_OFFSET)
str r0, NEGOFF_OFF1 (r1, TID_OFFSET)
str r0, NEGOFF_OFF2 (r1, PID_OFFSET, TID_OFFSET)
3:
#endif
@ pick the function arg and call address off the stack and execute
ldr r0, [sp, #4]
ldr ip, [sp], #8
BLX (ip)
@ and we are done, passing the return value through r0
b PLTJMP(HIDDEN_JUMPTARGET(_exit))
.fnend
weak_alias (__clone, clone)

6
sysdeps/unix/sysv/linux/arm/configure vendored Normal file
View File

@ -0,0 +1,6 @@
# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
# Local configure fragment for sysdeps/unix/sysv/linux/arm.
libc_cv_gcc_unwind_find_fde=no
# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
CFLAGS=${CFLAGS% -fno-unwind-tables}

View File

@ -0,0 +1,6 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/unix/sysv/linux/arm.
libc_cv_gcc_unwind_find_fde=no
# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
CFLAGS=${CFLAGS% -fno-unwind-tables}

View File

@ -0,0 +1,34 @@
/* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
Copyright (C) 2003-2014 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 <ldconfig.h>
/* In order to support the transition from unmarked objects
to marked objects we must treat unmarked objects as
compatible with either FLAG_ARM_LIBHF or FLAG_ARM_LIBSF. */
#ifdef __ARM_PCS_VFP
# define _dl_cache_check_flags(flags) \
((flags) == (FLAG_ARM_LIBHF | FLAG_ELF_LIBC6) \
|| (flags) == FLAG_ELF_LIBC6)
#else
# define _dl_cache_check_flags(flags) \
((flags) == (FLAG_ARM_LIBSF | FLAG_ELF_LIBC6) \
|| (flags) == FLAG_ELF_LIBC6)
#endif
#include_next <dl-cache.h>

View File

@ -0,0 +1,30 @@
/* Machine-dependent ELF dynamic relocation inline functions. ARM/Linux version
Copyright (C) 1995-2014 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/>. */
#ifndef dl_machine_h
/* This definition is Linux-specific. */
#define CLEAR_CACHE(BEG,END) \
INTERNAL_SYSCALL_ARM (cacheflush, , 3, (BEG), (END), 0)
#endif
/* The rest is just machine-specific.
This #include is outside the #ifndef because the parts of
dl-machine.h used only by dynamic-link.h are outside the guard. */
#include <sysdeps/arm/dl-machine.h>

View File

@ -0,0 +1,65 @@
/* Data for Linux/ARM version of processor capability information.
Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>, 2001.
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/>. */
/* This information must be kept in sync with the _DL_HWCAP_COUNT and
_DL_PLATFORM_COUNT definitions in procinfo.h.
If anything should be added here check whether the size of each string
is still ok with the given array size.
All the #ifdefs in the definitions ar equite irritating but
necessary if we want to avoid duplicating the information. There
are three different modes:
- PROCINFO_DECL is defined. This means we are only interested in
declarations.
- PROCINFO_DECL is not defined:
+ if SHARED is defined the file is included in an array
initializer. The .element = { ... } syntax is needed.
+ if SHARED is not defined a normal array initialization is
needed.
*/
#ifndef PROCINFO_CLASS
#define PROCINFO_CLASS
#endif
#if !defined PROCINFO_DECL && defined SHARED
._dl_arm_cap_flags
#else
PROCINFO_CLASS const char _dl_arm_cap_flags[19][10]
#endif
#ifndef PROCINFO_DECL
= {
"swp", "half", "thumb", "26bit", "fastmult", "fpa", "vfp", "edsp",
"java", "iwmmxt", "crunch", "thumbee", "neon", "vfpv3", "vfpv3d16",
"tls", "vfpv4", "idiva", "idivt",
}
#endif
#if !defined SHARED || defined PROCINFO_DECL
;
#else
,
#endif
#undef PROCINFO_DECL
#undef PROCINFO_CLASS

View File

@ -0,0 +1,78 @@
/* Linux/ARM version of processor capability information handling macros.
Copyright (C) 2001-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <philb@gnu.org>, 2001.
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/>. */
#ifndef _DL_PROCINFO_H
#define _DL_PROCINFO_H 1
#include <ldsodefs.h>
#include <sysdep.h>
#define _DL_HWCAP_COUNT 19
/* The kernel provides platform data but it is not interesting. */
#define _DL_HWCAP_PLATFORM 0
static inline int
__attribute__ ((unused))
_dl_procinfo (unsigned int type, unsigned long int word)
{
int i;
/* Fallback to unknown output mechanism. */
if (type == AT_HWCAP2)
return -1;
_dl_printf ("AT_HWCAP: ");
for (i = 0; i < _DL_HWCAP_COUNT; ++i)
if (word & (1 << i))
_dl_printf (" %s", GLRO(dl_arm_cap_flags)[i]);
_dl_printf ("\n");
return 0;
}
static inline const char *
__attribute__ ((unused))
_dl_hwcap_string (int idx)
{
return GLRO(dl_arm_cap_flags)[idx];
};
#define HWCAP_IMPORTANT (HWCAP_ARM_VFP | HWCAP_ARM_NEON)
static inline int
__attribute__ ((unused))
_dl_string_hwcap (const char *str)
{
int i;
for (i = 0; i < _DL_HWCAP_COUNT; i++)
{
if (strcmp (str, GLRO(dl_arm_cap_flags)[i]) == 0)
return i;
}
return -1;
};
#define _dl_string_platform(str) (-1)
#endif /* dl-procinfo.h */

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/fchown.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/fcntl.c>

View File

@ -0,0 +1,36 @@
/* Copyright (C) 1997-2014 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 <sys/types.h>
#include <errno.h>
#include <endian.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
/* Truncate the file FD refers to to LENGTH bytes. */
int
__ftruncate64 (int fd, off64_t length)
{
unsigned int low = length & 0xffffffff;
unsigned int high = length >> 32;
int result = INLINE_SYSCALL (ftruncate64, 4, fd, 0,
__LONG_LONG_PAIR (high, low));
return result;
}
weak_alias (__ftruncate64, ftruncate64)

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/fxstat.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/fxstatat.c>

View File

@ -0,0 +1,115 @@
/* Copyright (C) 2012-2014 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 <sysdep.h>
#include <rtld-global-offsets.h>
#include "ucontext_i.h"
.syntax unified
.text
/* int getcontext (ucontext_t *ucp) */
ENTRY(__getcontext)
/* No need to save r0-r3, d0-d7, or d16-d31. */
add r1, r0, #MCONTEXT_ARM_R4
stmia r1, {r4-r11}
/* Save R13 separately as Thumb can't STM it. */
str r13, [r0, #MCONTEXT_ARM_SP]
str r14, [r0, #MCONTEXT_ARM_LR]
/* Return to LR */
str r14, [r0, #MCONTEXT_ARM_PC]
/* Return zero */
mov r2, #0
str r2, [r0, #MCONTEXT_ARM_R0]
/* Save ucontext_t * across the next call. */
mov r4, r0
/* __sigprocmask(SIG_BLOCK, NULL, &(ucontext->uc_sigmask)) */
mov r0, #SIG_BLOCK
mov r1, #0
add r2, r4, #UCONTEXT_SIGMASK
bl PLTJMP(__sigprocmask)
/* Store FP regs. Much of the FP code is copied from arm/setjmp.S. */
#ifdef PIC
ldr r2, 1f
ldr r1, .Lrtld_global_ro
0: add r2, pc, r2
ldr r2, [r2, r1]
ldr r2, [r2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
#else
ldr r2, .Lhwcap
ldr r2, [r2, #0]
#endif
add r0, r4, #UCONTEXT_REGSPACE
#ifdef __SOFTFP__
tst r2, #HWCAP_ARM_VFP
beq .Lno_vfp
#endif
/* Store the VFP registers.
Don't use VFP instructions directly because this code
is used in non-VFP multilibs. */
/* Following instruction is vstmia r0!, {d8-d15}. */
stc p11, cr8, [r0], #64
/* Store the floating-point status register. */
/* Following instruction is vmrs r1, fpscr. */
mrc p10, 7, r1, cr1, cr0, 0
str r1, [r0], #4
.Lno_vfp:
tst r2, #HWCAP_ARM_IWMMXT
beq .Lno_iwmmxt
/* Save the call-preserved iWMMXt registers. */
/* Following instructions are wstrd wr10, [r0], #8 (etc.) */
stcl p1, cr10, [r0], #8
stcl p1, cr11, [r0], #8
stcl p1, cr12, [r0], #8
stcl p1, cr13, [r0], #8
stcl p1, cr14, [r0], #8
stcl p1, cr15, [r0], #8
.Lno_iwmmxt:
/* Restore the clobbered R4 and LR. */
ldr r14, [r4, #MCONTEXT_ARM_LR]
ldr r4, [r4, #MCONTEXT_ARM_R4]
mov r0, #0
DO_RET(r14)
END(__getcontext)
#ifdef PIC
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
#else
.Lhwcap:
.long C_SYMBOL_NAME(_dl_hwcap)
#endif
weak_alias(__getcontext, getcontext)

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getdents64.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getegid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/geteuid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getgid.c>

View File

@ -0,0 +1,2 @@
/* We also have to rewrite the kernel gid_t to the user land type. */
#include <sysdeps/unix/sysv/linux/i386/getgroups.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getresgid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getresuid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/getuid.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/glob64.c>

View File

@ -0,0 +1,6 @@
/* Tag_ABI_align8_preserved: This code preserves 8-byte
alignment in any callee. */
.eabi_attribute 25, 1
/* Tag_ABI_align8_needed: This code may require 8-byte alignment from
the caller. */
.eabi_attribute 24, 1

View File

@ -0,0 +1,6 @@
/* Tag_ABI_align8_preserved: This code preserves 8-byte
alignment in any callee. */
.eabi_attribute 25, 1
/* Tag_ABI_align8_needed: This code may require 8-byte alignment from
the caller. */
.eabi_attribute 24, 1

View File

@ -0,0 +1,6 @@
/* Tag_ABI_align8_preserved: This code preserves 8-byte
alignment in any callee. */
.eabi_attribute 25, 1
/* Tag_ABI_align8_needed: This code may require 8-byte alignment from
the caller. */
.eabi_attribute 24, 1

View File

@ -0,0 +1,279 @@
/* Copyright (C) 1998-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Phil Blundell, based on the Alpha version by
David Mosberger.
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/>. */
/* I/O port access on the ARM is something of a fiction. What we do is to
map an appropriate area of /dev/mem into user space so that a program
can blast away at the hardware in such a way as to generate I/O cycles
on the bus. To insulate user code from dependencies on particular
hardware we don't allow calls to inb() and friends to be inlined, but
force them to come through code in here every time. Performance-critical
registers tend to be memory mapped these days so this should be no big
problem. */
/* Once upon a time this file used mprotect to enable and disable
access to particular areas of I/O space. Unfortunately the
mprotect syscall also has the side effect of enabling caching for
the area affected (this is a kernel limitation). So we now just
enable all the ports all of the time. */
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <linux/version.h>
#include <sys/sysctl.h>
#define PATH_ARM_SYSTYPE "/etc/arm_systype"
#define PATH_CPUINFO "/proc/cpuinfo"
#define MAX_PORT 0x10000
static struct {
unsigned long int base;
unsigned long int io_base;
unsigned int shift;
unsigned int initdone; /* since all the above could be 0 */
} io;
#define IO_BASE_FOOTBRIDGE 0x7c000000
#define IO_SHIFT_FOOTBRIDGE 0
static struct platform {
const char *name;
unsigned long int io_base;
unsigned int shift;
} platform[] = {
/* All currently supported platforms are in fact the same. :-) */
{"Chalice-CATS", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
{"DEC-EBSA285", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
{"Corel-NetWinder", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
{"Rebel-NetWinder", IO_BASE_FOOTBRIDGE, IO_SHIFT_FOOTBRIDGE},
};
#define IO_ADDR(port) (io.base + ((port) << io.shift))
/*
* Initialize I/O system. There are several ways to get the information
* we need. Each is tried in turn until one succeeds.
*
* 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*). This is the preferred method
* but not all kernels support it.
*
* 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE.
* - If it matches one of the entries in the table above, use the
* corresponding values.
* - If it begins with a number, assume this is a previously
* unsupported system and the values encode, in order,
* "<io_base>,<port_shift>".
*
* 3. Lookup the "system type" field in /proc/cpuinfo. Again, if it
* matches an entry in the platform[] table, use the corresponding
* values.
*/
/* The Linux kernel headers renamed this constant between 2.5.26 and
2.5.27. It was backported to 2.4 between 2.4.22 and 2.4.23. */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,23)
# define BUS_ISA CTL_BUS_ISA
#endif
static int
init_iosys (void)
{
char systype[256];
int i, n;
static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
size_t len = sizeof(io.base);
if (! __sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
&& ! __sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0))
{
io.initdone = 1;
return 0;
}
n = __readlink (PATH_ARM_SYSTYPE, systype, sizeof (systype) - 1);
if (n > 0)
{
systype[n] = '\0';
if (isdigit (systype[0]))
{
if (sscanf (systype, "%li,%i", &io.io_base, &io.shift) == 2)
{
io.initdone = 1;
return 0;
}
/* else we're likely going to fail with the system match below */
}
}
else
{
FILE * fp;
fp = fopen (PATH_CPUINFO, "rce");
if (! fp)
return -1;
while ((n = fscanf (fp, "Hardware\t: %256[^\n]\n", systype))
!= EOF)
{
if (n == 1)
break;
else
fgets_unlocked (systype, 256, fp);
}
fclose (fp);
if (n == EOF)
{
/* this can happen if the format of /proc/cpuinfo changes... */
fprintf (stderr,
"ioperm: Unable to determine system type.\n"
"\t(May need " PATH_ARM_SYSTYPE " symlink?)\n");
__set_errno (ENODEV);
return -1;
}
}
/* translate systype name into i/o system: */
for (i = 0; i < sizeof (platform) / sizeof (platform[0]); ++i)
{
if (strcmp (platform[i].name, systype) == 0)
{
io.shift = platform[i].shift;
io.io_base = platform[i].io_base;
io.initdone = 1;
return 0;
}
}
/* systype is not a known platform name... */
__set_errno (ENODEV);
return -1;
}
int
_ioperm (unsigned long int from, unsigned long int num, int turn_on)
{
if (! io.initdone && init_iosys () < 0)
return -1;
/* this test isn't as silly as it may look like; consider overflows! */
if (from >= MAX_PORT || from + num > MAX_PORT)
{
__set_errno (EINVAL);
return -1;
}
if (turn_on)
{
if (! io.base)
{
int fd;
fd = __open ("/dev/mem", O_RDWR);
if (fd < 0)
return -1;
io.base =
(unsigned long int) __mmap (0, MAX_PORT << io.shift,
PROT_READ | PROT_WRITE,
MAP_SHARED, fd, io.io_base);
__close (fd);
if ((long) io.base == -1)
return -1;
}
}
return 0;
}
int
_iopl (unsigned int level)
{
if (level > 3)
{
__set_errno (EINVAL);
return -1;
}
if (level)
{
return _ioperm (0, MAX_PORT, 1);
}
return 0;
}
void
_outb (unsigned char b, unsigned long int port)
{
*((volatile unsigned char *)(IO_ADDR (port))) = b;
}
void
_outw (unsigned short b, unsigned long int port)
{
*((volatile unsigned short *)(IO_ADDR (port))) = b;
}
void
_outl (unsigned int b, unsigned long int port)
{
*((volatile unsigned long *)(IO_ADDR (port))) = b;
}
unsigned int
_inb (unsigned long int port)
{
return *((volatile unsigned char *)(IO_ADDR (port)));
}
unsigned int
_inw (unsigned long int port)
{
return *((volatile unsigned short *)(IO_ADDR (port)));
}
unsigned int
_inl (unsigned long int port)
{
return *((volatile unsigned long *)(IO_ADDR (port)));
}
weak_alias (_ioperm, ioperm);
weak_alias (_iopl, iopl);
weak_alias (_inb, inb);
weak_alias (_inw, inw);
weak_alias (_inl, inl);
weak_alias (_outb, outb);
weak_alias (_outw, outw);
weak_alias (_outl, outl);

View File

@ -0,0 +1,45 @@
/* Set flags signalling availability of kernel features based on given
kernel version number.
Copyright (C) 2006-2014 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/>. */
/* The utimes syscall was added before 2.6.1. */
#define __ASSUME_UTIMES 1
/* The signal frame layout changed in 2.6.18. */
#if __LINUX_KERNEL_VERSION >= 132626
# define __ASSUME_SIGFRAME_V2 1
#endif
/* Support for the eventfd2 and signalfd4 syscalls was added in 2.6.27. */
#if __LINUX_KERNEL_VERSION >= 0x02061b
# define __ASSUME_EVENTFD2 1
# define __ASSUME_SIGNALFD4 1
#endif
/* Support for the accept4 syscall was added in 2.6.36. */
#if __LINUX_KERNEL_VERSION >= 0x020624
# define __ASSUME_ACCEPT4 1
#endif
#include_next <kernel-features.h>
/* Support for pselect6, ppoll and epoll_pwait was added in 2.6.32. */
#if __LINUX_KERNEL_VERSION < 0x020620
# undef __ASSUME_PSELECT
# undef __ASSUME_PPOLL
#endif

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/lchown.c>

View File

@ -0,0 +1,25 @@
/* Copyright (C) 2001-2014 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 <sysdeps/generic/ldconfig.h>
#define SYSDEP_KNOWN_INTERPRETER_NAMES \
{ "/lib/ld-linux.so.3", FLAG_ELF_LIBC6 }, \
{ "/lib/ld-linux-armhf.so.3", FLAG_ELF_LIBC6 },
#define SYSDEP_KNOWN_LIBRARY_NAMES \
{ "libc.so.6", FLAG_ELF_LIBC6 }, \
{ "libm.so.6", FLAG_ELF_LIBC6 },

View File

@ -0,0 +1,73 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
Copyright (C) 2010-2014 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/>. */
#ifndef _ARM_LINUX_LDSODEFS_H
#define _ARM_LINUX_LDSODEFS_H 1
#include_next <ldsodefs.h>
#undef VALID_ELF_HEADER
#undef VALID_ELF_OSABI
#undef MORE_ELF_HEADER_DATA
#define EXTRA_OSABI ELFOSABI_ARM_AEABI
#ifdef __ARM_PCS_VFP
# define VALID_FLOAT_ABI(x) \
((EF_ARM_EABI_VERSION ((x)) != EF_ARM_EABI_VER5) \
|| !((x) & EF_ARM_ABI_FLOAT_SOFT))
#else
# define VALID_FLOAT_ABI(x) \
((EF_ARM_EABI_VERSION ((x)) != EF_ARM_EABI_VER5) \
|| !((x) & EF_ARM_ABI_FLOAT_HARD))
#endif
#undef VALID_ELF_HEADER
#define VALID_ELF_HEADER(hdr,exp,size) \
((memcmp (hdr, exp, size) == 0 \
|| memcmp (hdr, expected2, size) == 0 \
|| memcmp (hdr, expected3, size) == 0) \
&& VALID_FLOAT_ABI (ehdr->e_flags))
#define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \
|| osabi == ELFOSABI_GNU \
|| osabi == EXTRA_OSABI)
#define MORE_ELF_HEADER_DATA \
static const unsigned char expected2[EI_PAD] = \
{ \
[EI_MAG0] = ELFMAG0, \
[EI_MAG1] = ELFMAG1, \
[EI_MAG2] = ELFMAG2, \
[EI_MAG3] = ELFMAG3, \
[EI_CLASS] = ELFW(CLASS), \
[EI_DATA] = byteorder, \
[EI_VERSION] = EV_CURRENT, \
[EI_OSABI] = ELFOSABI_GNU \
}; \
static const unsigned char expected3[EI_PAD] = \
{ \
[EI_MAG0] = ELFMAG0, \
[EI_MAG1] = ELFMAG1, \
[EI_MAG2] = ELFMAG2, \
[EI_MAG3] = ELFMAG3, \
[EI_CLASS] = ELFW(CLASS), \
[EI_DATA] = byteorder, \
[EI_VERSION] = EV_CURRENT, \
[EI_OSABI] = EXTRA_OSABI \
}
#endif

View File

@ -0,0 +1 @@
#include <aeabi_read_tp.S>

View File

@ -0,0 +1,48 @@
/* Copyright (C) 2010-2014 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 <sysdep.h>
/* Out-of-line syscall stub. We expect the system call number in ip
and return the raw result in r0. No registers are clobbered.
We could avoid using the stack for this, but the goal is accurate
unwind information - and while there is a reserved prefix in the
ARM unwind tables for register to register moves, the actual opcodes
are not defined. */
#if defined(__thumb__)
.thumb
.syntax unified
.hidden __libc_do_syscall
#undef CALL_MCOUNT
#define CALL_MCOUNT
ENTRY (__libc_do_syscall)
.fnstart
push {r7, lr}
.save {r7, lr}
cfi_adjust_cfa_offset (8)
cfi_rel_offset (r7, 0)
cfi_rel_offset (lr, 4)
mov r7, ip
swi 0x0
pop {r7, pc}
.fnend
END (__libc_do_syscall)
#endif /* __thumb__ */

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/lockf64.c>

View File

@ -0,0 +1,2 @@
#include <sysdeps/unix/sysv/linux/i386/lxstat.c>

View File

@ -0,0 +1,73 @@
/* Copyright (C) 2012-2014 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 <stdarg.h>
#include <ucontext.h>
/* Number of arguments that go in registers. */
#define NREG_ARGS 4
/* Take a context previously prepared via getcontext() and set to
call func() with the given int only args. */
void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
extern void __startcontext (void);
unsigned long *funcstack;
va_list vl;
unsigned long *regptr;
unsigned int reg;
int misaligned;
/* Start at the top of stack. */
funcstack = (unsigned long *) (ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
/* Ensure the stack stays eight byte aligned. */
misaligned = ((unsigned long) funcstack & 4) != 0;
if ((argc > NREG_ARGS) && (argc & 1) != 0)
misaligned = !misaligned;
if (misaligned)
funcstack -= 1;
va_start (vl, argc);
/* Reserve space for the on-stack arguments. */
if (argc > NREG_ARGS)
funcstack -= (argc - NREG_ARGS);
ucp->uc_mcontext.arm_sp = (unsigned long) funcstack;
ucp->uc_mcontext.arm_pc = (unsigned long) func;
/* Exit to startcontext() with the next context in R4 */
ucp->uc_mcontext.arm_r4 = (unsigned long) ucp->uc_link;
ucp->uc_mcontext.arm_lr = (unsigned long) __startcontext;
/* The first four arguments go into registers. */
regptr = &(ucp->uc_mcontext.arm_r0);
for (reg = 0; (reg < argc) && (reg < NREG_ARGS); reg++)
*regptr++ = va_arg (vl, unsigned long);
/* And the remainder on the stack. */
for (; reg < argc; reg++)
*funcstack++ = va_arg (vl, unsigned long);
va_end (vl);
}
weak_alias (__makecontext, makecontext)

View File

@ -0,0 +1,64 @@
/* Copyright (C) 1998-2014 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 <sysdep.h>
#define EINVAL 22
.text
ENTRY (__mmap)
/* shuffle args */
push { r5 }
cfi_adjust_cfa_offset (4)
cfi_rel_offset (r5, 0)
ldr r5, [sp, #8]
push { r4 }
cfi_adjust_cfa_offset (4)
cfi_rel_offset (r4, 0)
cfi_remember_state
ldr r4, [sp, #8]
/* convert offset to pages */
movs ip, r5, lsl #20
bne .Linval
mov r5, r5, lsr #12
/* do the syscall */
DO_CALL (mmap2, 0)
/* restore registers */
2:
pop { r4 }
cfi_adjust_cfa_offset (-4)
cfi_restore (r4)
pop { r5 }
cfi_adjust_cfa_offset (-4)
cfi_restore (r5)
cmn r0, $4096
it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
cfi_restore_state
.Linval:
mov r0, #-EINVAL
b 2b
PSEUDO_END (__mmap)
weak_alias (__mmap, mmap)

View File

@ -0,0 +1,72 @@
/* Copyright (C) 2000-2014 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 <sysdep.h>
.syntax unified
#define EINVAL 22
#ifdef __ARMEB__
# define LOW_OFFSET 8 + 4
/* The initial + 4 is for the stack postdecrement. */
# define HIGH_OFFSET 4 + 8 + 0
#else
# define LOW_OFFSET 8 + 0
# define HIGH_OFFSET 4 + 8 + 4
#endif
/* The mmap2 system call takes six arguments, all in registers. */
.text
ENTRY (__mmap64)
ldr ip, [sp, $LOW_OFFSET]
push { r5 }
cfi_adjust_cfa_offset (4)
cfi_rel_offset (r5, 0)
ldr r5, [sp, $HIGH_OFFSET]
push { r4 }
cfi_adjust_cfa_offset (4)
cfi_rel_offset (r4, 0)
cfi_remember_state
movs r4, ip, lsl $20 @ check that offset is page-aligned
mov ip, ip, lsr $12
it eq
movseq r4, r5, lsr $12 @ check for overflow
bne .Linval
ldr r4, [sp, $8] @ load fd
orr r5, ip, r5, lsl $20 @ compose page offset
DO_CALL (mmap2, 0)
cmn r0, $4096
pop {r4, r5}
cfi_adjust_cfa_offset (-8)
cfi_restore (r4)
cfi_restore (r5)
it cc
RETINSTR(cc, lr)
b PLTJMP(syscall_error)
cfi_restore_state
.Linval:
mov r0, $-EINVAL
pop {r4, r5}
cfi_adjust_cfa_offset (-8)
cfi_restore (r4)
cfi_restore (r5)
b PLTJMP(syscall_error)
PSEUDO_END (__mmap64)
weak_alias (__mmap64, mmap64)

View File

@ -0,0 +1,33 @@
/* Copyright (C) 1995-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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 <errno.h>
#include <sys/msg.h>
#include <ipc_priv.h>
#include <sysdep.h>
#include <sys/syscall.h>
int
__new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
return INLINE_SYSCALL (msgctl, 3, msqid, cmd | __IPC_64, buf);
}
#include <shlib-compat.h>
versioned_symbol (libc, __new_msgctl, msgctl, GLIBC_2_2);

View File

@ -0,0 +1,17 @@
ifeq ($(subdir),rt)
librt-sysdep_routines += rt-aeabi_unwind_cpp_pr1
librt-shared-only-routines += rt-aeabi_unwind_cpp_pr1
endif
ifeq ($(subdir),nptl)
libpthread-sysdep_routines += nptl-aeabi_unwind_cpp_pr1
libpthread-shared-only-routines += nptl-aeabi_unwind_cpp_pr1
# This test relies on compiling part of the binary with EH information,
# part without, and unwinding through. The .ARM.exidx tables have
# start addresses for EH regions, but no end addresses. Every
# region an exception needs to propogate through must have unwind
# information, or a previous function's unwind table may be used
# by mistake.
tests := $(filter-out tst-cleanupx4,$(tests))
endif

View File

@ -0,0 +1,8 @@
libc {
GLIBC_PRIVATE {
# A copy of sigaction lives in NPTL, and needs these.
__default_sa_restorer; __default_rt_sa_restorer;
__default_sa_restorer_v1; __default_rt_sa_restorer_v1;
__default_sa_restorer_v2; __default_rt_sa_restorer_v2;
}
}

View File

@ -0,0 +1,184 @@
/* Copyright (C) 2002-2014 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/>. */
#ifndef _BITS_PTHREADTYPES_H
#define _BITS_PTHREADTYPES_H 1
#include <endian.h>
#define __SIZEOF_PTHREAD_ATTR_T 36
#define __SIZEOF_PTHREAD_MUTEX_T 24
#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
#define __SIZEOF_PTHREAD_COND_T 48
#define __SIZEOF_PTHREAD_COND_COMPAT_T 12
#define __SIZEOF_PTHREAD_CONDATTR_T 4
#define __SIZEOF_PTHREAD_RWLOCK_T 32
#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
#define __SIZEOF_PTHREAD_BARRIER_T 20
#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
/* Thread identifiers. The structure of the attribute type is not
exposed on purpose. */
typedef unsigned long int pthread_t;
union pthread_attr_t
{
char __size[__SIZEOF_PTHREAD_ATTR_T];
long int __align;
};
#ifndef __have_pthread_attr_t
typedef union pthread_attr_t pthread_attr_t;
# define __have_pthread_attr_t 1
#endif
typedef struct __pthread_internal_slist
{
struct __pthread_internal_slist *__next;
} __pthread_slist_t;
/* Data structures for mutex handling. The structure of the attribute
type is not exposed on purpose. */
typedef union
{
struct __pthread_mutex_s
{
int __lock;
unsigned int __count;
int __owner;
/* KIND must stay at this position in the structure to maintain
binary compatibility. */
int __kind;
unsigned int __nusers;
__extension__ union
{
int __spins;
__pthread_slist_t __list;
};
} __data;
char __size[__SIZEOF_PTHREAD_MUTEX_T];
long int __align;
} pthread_mutex_t;
typedef union
{
char __size[__SIZEOF_PTHREAD_MUTEXATTR_T];
long int __align;
} pthread_mutexattr_t;
/* Data structure for conditional variable handling. The structure of
the attribute type is not exposed on purpose. */
typedef union
{
struct
{
int __lock;
unsigned int __futex;
__extension__ unsigned long long int __total_seq;
__extension__ unsigned long long int __wakeup_seq;
__extension__ unsigned long long int __woken_seq;
void *__mutex;
unsigned int __nwaiters;
unsigned int __broadcast_seq;
} __data;
char __size[__SIZEOF_PTHREAD_COND_T];
__extension__ long long int __align;
} pthread_cond_t;
typedef union
{
char __size[__SIZEOF_PTHREAD_CONDATTR_T];
long int __align;
} pthread_condattr_t;
/* Keys for thread-specific data */
typedef unsigned int pthread_key_t;
/* Once-only execution */
typedef int pthread_once_t;
#if defined __USE_UNIX98 || defined __USE_XOPEN2K
/* Data structure for read-write lock variable handling. The
structure of the attribute type is not exposed on purpose. */
typedef union
{
struct
{
int __lock;
unsigned int __nr_readers;
unsigned int __readers_wakeup;
unsigned int __writer_wakeup;
unsigned int __nr_readers_queued;
unsigned int __nr_writers_queued;
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned char __pad1;
unsigned char __pad2;
unsigned char __shared;
/* FLAGS must stay at this position in the structure to maintain
binary compatibility. */
unsigned char __flags;
#else
/* FLAGS must stay at this position in the structure to maintain
binary compatibility. */
unsigned char __flags;
unsigned char __shared;
unsigned char __pad1;
unsigned char __pad2;
#endif
int __writer;
} __data;
char __size[__SIZEOF_PTHREAD_RWLOCK_T];
long int __align;
} pthread_rwlock_t;
typedef union
{
char __size[__SIZEOF_PTHREAD_RWLOCKATTR_T];
long int __align;
} pthread_rwlockattr_t;
#endif
#ifdef __USE_XOPEN2K
/* POSIX spinlock data type. */
typedef volatile int pthread_spinlock_t;
/* POSIX barriers data type. The structure of the type is
deliberately not exposed. */
typedef union
{
char __size[__SIZEOF_PTHREAD_BARRIER_T];
long int __align;
} pthread_barrier_t;
typedef union
{
char __size[__SIZEOF_PTHREAD_BARRIERATTR_T];
int __align;
} pthread_barrierattr_t;
#endif
#endif /* bits/pthreadtypes.h */

View File

@ -0,0 +1,34 @@
/* Copyright (C) 2002-2014 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/>. */
#ifndef _SEMAPHORE_H
# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
#endif
#define __SIZEOF_SEM_T 16
/* Value returned if `sem_open' failed. */
#define SEM_FAILED ((sem_t *) 0)
typedef union
{
char __size[__SIZEOF_SEM_T];
long int __align;
} sem_t;

View File

@ -0,0 +1,67 @@
blkcnt64_t:x
blkcnt_t:l
blksize_t:l
caddr_t:Pc
clockid_t:i
clock_t:l
daddr_t:i
dev_t:y
fd_mask:l
fsblkcnt64_t:y
fsblkcnt_t:m
fsfilcnt64_t:y
fsfilcnt_t:m
fsid_t:8__fsid_t
gid_t:j
id_t:j
ino64_t:y
ino_t:m
int16_t:s
int32_t:i
int64_t:x
int8_t:a
intptr_t:i
key_t:i
loff_t:x
mode_t:j
nlink_t:j
off64_t:x
off_t:l
pid_t:i
pthread_attr_t:14pthread_attr_t
pthread_barrier_t:17pthread_barrier_t
pthread_barrierattr_t:21pthread_barrierattr_t
pthread_cond_t:14pthread_cond_t
pthread_condattr_t:18pthread_condattr_t
pthread_key_t:j
pthread_mutex_t:15pthread_mutex_t
pthread_mutexattr_t:19pthread_mutexattr_t
pthread_once_t:i
pthread_rwlock_t:16pthread_rwlock_t
pthread_rwlockattr_t:20pthread_rwlockattr_t
pthread_spinlock_t:i
pthread_t:m
quad_t:x
register_t:i
rlim64_t:y
rlim_t:m
sigset_t:10__sigset_t
size_t:j
socklen_t:j
ssize_t:i
suseconds_t:l
time_t:l
u_char:h
uid_t:j
uint:j
u_int:j
u_int16_t:t
u_int32_t:j
u_int64_t:y
u_int8_t:h
ulong:m
u_long:m
u_quad_t:y
useconds_t:j
ushort:t
u_short:t

View File

@ -0,0 +1,3 @@
#define RESET_PID
#include <tcb-offsets.h>
#include "../clone.S"

View File

@ -0,0 +1,4 @@
# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
libc_cv_gcc_exceptions=yes
exceptions=-fexceptions

View File

@ -0,0 +1,8 @@
dnl configure fragment for NPTL and ARM/Linux EABI.
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
dnl The normal configure check for gcc -fexecptions fails because it can't
dnl find __aeabi_unwind_cpp_pr0. Work around this here; our GCC definitely
dnl has -fexceptions.
libc_cv_gcc_exceptions=yes
exceptions=-fexceptions

View File

@ -0,0 +1,22 @@
/* Copyright (C) 2005-2014 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/>. */
/* Value passed to 'clone' for initialization of the thread register. */
#define TLS_VALUE (pd + 1)
/* Get the real implementation. */
#include <nptl/sysdeps/pthread/createthread.c>

View File

@ -0,0 +1,30 @@
/* Copyright (C) 2005-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Phil Blundell <pb@nexus.co.uk>, 2005
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 <sched.h>
#include <signal.h>
#include <sysdep.h>
#include <tls.h>
#define ARCH_FORK() \
INLINE_SYSCALL (clone, 5, \
CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD, \
NULL, NULL, NULL, &THREAD_SELF->tid)
#include <nptl/sysdeps/unix/sysv/linux/fork.c>

View File

@ -0,0 +1,12 @@
GLIBC_2.4
GLIBC_2.4 A
__libc_memalign F
__libc_stack_end D 0x4
__stack_chk_guard D 0x4
__tls_get_addr F
_dl_mcount F
_r_debug D 0x14
calloc F
free F
malloc F
realloc F

View File

@ -0,0 +1,3 @@
GLIBC_2.4
GLIBC_2.4 A
__ctype_get_mb_cur_max F

View File

@ -0,0 +1,6 @@
GLIBC_2.4
GLIBC_2.4 A
gai_cancel F
gai_error F
gai_suspend F
getaddrinfo_a F

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
GLIBC_2.4
GLIBC_2.4 A
crypt F
crypt_r F
encrypt F
encrypt_r F
fcrypt F
setkey F
setkey_r F

View File

@ -0,0 +1,11 @@
GLIBC_2.4
GLIBC_2.4 A
dladdr F
dladdr1 F
dlclose F
dlerror F
dlinfo F
dlmopen F
dlopen F
dlsym F
dlvsym F

View File

@ -0,0 +1,374 @@
GLIBC_2.15
GLIBC_2.15 A
__acos_finite F
__acosf_finite F
__acosh_finite F
__acoshf_finite F
__asin_finite F
__asinf_finite F
__atan2_finite F
__atan2f_finite F
__atanh_finite F
__atanhf_finite F
__cosh_finite F
__coshf_finite F
__exp10_finite F
__exp10f_finite F
__exp2_finite F
__exp2f_finite F
__exp_finite F
__expf_finite F
__fmod_finite F
__fmodf_finite F
__gamma_r_finite F
__gammaf_r_finite F
__hypot_finite F
__hypotf_finite F
__j0_finite F
__j0f_finite F
__j1_finite F
__j1f_finite F
__jn_finite F
__jnf_finite F
__lgamma_r_finite F
__lgammaf_r_finite F
__log10_finite F
__log10f_finite F
__log2_finite F
__log2f_finite F
__log_finite F
__logf_finite F
__pow_finite F
__powf_finite F
__remainder_finite F
__remainderf_finite F
__scalb_finite F
__scalbf_finite F
__sinh_finite F
__sinhf_finite F
__sqrt_finite F
__sqrtf_finite F
__y0_finite F
__y0f_finite F
__y1_finite F
__y1f_finite F
__yn_finite F
__ynf_finite F
GLIBC_2.18
GLIBC_2.18 A
__issignaling F
__issignalingf F
GLIBC_2.4
GLIBC_2.4 A
_LIB_VERSION D 0x4
__clog10 F
__clog10f F
__clog10l F
__finite F
__finitef F
__finitel F
__fpclassify F
__fpclassifyf F
__signbit F
__signbitf F
acos F
acosf F
acosh F
acoshf F
acoshl F
acosl F
asin F
asinf F
asinh F
asinhf F
asinhl F
asinl F
atan F
atan2 F
atan2f F
atan2l F
atanf F
atanh F
atanhf F
atanhl F
atanl F
cabs F
cabsf F
cabsl F
cacos F
cacosf F
cacosh F
cacoshf F
cacoshl F
cacosl F
carg F
cargf F
cargl F
casin F
casinf F
casinh F
casinhf F
casinhl F
casinl F
catan F
catanf F
catanh F
catanhf F
catanhl F
catanl F
cbrt F
cbrtf F
cbrtl F
ccos F
ccosf F
ccosh F
ccoshf F
ccoshl F
ccosl F
ceil F
ceilf F
ceill F
cexp F
cexpf F
cexpl F
cimag F
cimagf F
cimagl F
clog F
clog10 F
clog10f F
clog10l F
clogf F
clogl F
conj F
conjf F
conjl F
copysign F
copysignf F
copysignl F
cos F
cosf F
cosh F
coshf F
coshl F
cosl F
cpow F
cpowf F
cpowl F
cproj F
cprojf F
cprojl F
creal F
crealf F
creall F
csin F
csinf F
csinh F
csinhf F
csinhl F
csinl F
csqrt F
csqrtf F
csqrtl F
ctan F
ctanf F
ctanh F
ctanhf F
ctanhl F
ctanl F
drem F
dremf F
dreml F
erf F
erfc F
erfcf F
erfcl F
erff F
erfl F
exp F
exp10 F
exp10f F
exp10l F
exp2 F
exp2f F
exp2l F
expf F
expl F
expm1 F
expm1f F
expm1l F
fabs F
fabsf F
fabsl F
fdim F
fdimf F
fdiml F
feclearexcept F
fedisableexcept F
feenableexcept F
fegetenv F
fegetexcept F
fegetexceptflag F
fegetround F
feholdexcept F
feraiseexcept F
fesetenv F
fesetexceptflag F
fesetround F
fetestexcept F
feupdateenv F
finite F
finitef F
finitel F
floor F
floorf F
floorl F
fma F
fmaf F
fmal F
fmax F
fmaxf F
fmaxl F
fmin F
fminf F
fminl F
fmod F
fmodf F
fmodl F
frexp F
frexpf F
frexpl F
gamma F
gammaf F
gammal F
hypot F
hypotf F
hypotl F
ilogb F
ilogbf F
ilogbl F
j0 F
j0f F
j0l F
j1 F
j1f F
j1l F
jn F
jnf F
jnl F
ldexp F
ldexpf F
ldexpl F
lgamma F
lgamma_r F
lgammaf F
lgammaf_r F
lgammal F
lgammal_r F
llrint F
llrintf F
llrintl F
llround F
llroundf F
llroundl F
log F
log10 F
log10f F
log10l F
log1p F
log1pf F
log1pl F
log2 F
log2f F
log2l F
logb F
logbf F
logbl F
logf F
logl F
lrint F
lrintf F
lrintl F
lround F
lroundf F
lroundl F
matherr F
modf F
modff F
modfl F
nan F
nanf F
nanl F
nearbyint F
nearbyintf F
nearbyintl F
nextafter F
nextafterf F
nextafterl F
nexttoward F
nexttowardf F
nexttowardl F
pow F
pow10 F
pow10f F
pow10l F
powf F
powl F
remainder F
remainderf F
remainderl F
remquo F
remquof F
remquol F
rint F
rintf F
rintl F
round F
roundf F
roundl F
scalb F
scalbf F
scalbl F
scalbln F
scalblnf F
scalblnl F
scalbn F
scalbnf F
scalbnl F
signgam D 0x4
significand F
significandf F
significandl F
sin F
sincos F
sincosf F
sincosl F
sinf F
sinh F
sinhf F
sinhl F
sinl F
sqrt F
sqrtf F
sqrtl F
tan F
tanf F
tanh F
tanhf F
tanhl F
tanl F
tgamma F
tgammaf F
tgammal F
trunc F
truncf F
truncl F
y0 F
y0f F
y0l F
y1 F
y1f F
y1l F
yn F
ynf F
ynl F

View File

@ -0,0 +1,123 @@
GLIBC_2.4
GLIBC_2.4 A
__free_fdresult F
__nis_default_access F
__nis_default_group F
__nis_default_owner F
__nis_default_ttl F
__nis_finddirectory F
__nis_hash F
__nisbind_connect F
__nisbind_create F
__nisbind_destroy F
__nisbind_next F
__yp_check F
nis_add F
nis_add_entry F
nis_addmember F
nis_checkpoint F
nis_clone_directory F
nis_clone_object F
nis_clone_result F
nis_creategroup F
nis_destroy_object F
nis_destroygroup F
nis_dir_cmp F
nis_domain_of F
nis_domain_of_r F
nis_first_entry F
nis_free_directory F
nis_free_object F
nis_free_request F
nis_freenames F
nis_freeresult F
nis_freeservlist F
nis_freetags F
nis_getnames F
nis_getservlist F
nis_ismember F
nis_leaf_of F
nis_leaf_of_r F
nis_lerror F
nis_list F
nis_local_directory F
nis_local_group F
nis_local_host F
nis_local_principal F
nis_lookup F
nis_mkdir F
nis_modify F
nis_modify_entry F
nis_name_of F
nis_name_of_r F
nis_next_entry F
nis_perror F
nis_ping F
nis_print_directory F
nis_print_entry F
nis_print_group F
nis_print_group_entry F
nis_print_link F
nis_print_object F
nis_print_result F
nis_print_rights F
nis_print_table F
nis_read_obj F
nis_remove F
nis_remove_entry F
nis_removemember F
nis_rmdir F
nis_servstate F
nis_sperrno F
nis_sperror F
nis_sperror_r F
nis_stats F
nis_verifygroup F
nis_write_obj F
readColdStartFile F
writeColdStartFile F
xdr_cback_data F
xdr_domainname F
xdr_keydat F
xdr_mapname F
xdr_obj_p F
xdr_peername F
xdr_valdat F
xdr_yp_buf F
xdr_ypall F
xdr_ypbind_binding F
xdr_ypbind_resp F
xdr_ypbind_resptype F
xdr_ypbind_setdom F
xdr_ypdelete_args F
xdr_ypmap_parms F
xdr_ypmaplist F
xdr_yppush_status F
xdr_yppushresp_xfr F
xdr_ypreq_key F
xdr_ypreq_nokey F
xdr_ypreq_xfr F
xdr_ypresp_all F
xdr_ypresp_key_val F
xdr_ypresp_maplist F
xdr_ypresp_master F
xdr_ypresp_order F
xdr_ypresp_val F
xdr_ypresp_xfr F
xdr_ypstat F
xdr_ypupdate_args F
xdr_ypxfrstat F
yp_all F
yp_bind F
yp_first F
yp_get_default_domain F
yp_maplist F
yp_master F
yp_match F
yp_next F
yp_order F
yp_unbind F
yp_update F
ypbinderr_string F
yperr_string F
ypprot_err F

View File

@ -0,0 +1,232 @@
GLIBC_2.11
GLIBC_2.11 A
pthread_sigqueue F
GLIBC_2.12
GLIBC_2.12 A
pthread_getname_np F
pthread_mutex_consistent F
pthread_mutexattr_getrobust F
pthread_mutexattr_setrobust F
pthread_setname_np F
GLIBC_2.18
GLIBC_2.18 A
pthread_getattr_default_np F
pthread_setattr_default_np F
GLIBC_2.4
GLIBC_2.4 A
_IO_flockfile F
_IO_ftrylockfile F
_IO_funlockfile F
__close F
__connect F
__errno_location F
__fcntl F
__fork F
__h_errno_location F
__libc_allocate_rtsig F
__libc_current_sigrtmax F
__libc_current_sigrtmin F
__lseek F
__nanosleep F
__open F
__open64 F
__pread64 F
__pthread_cleanup_routine F
__pthread_getspecific F
__pthread_key_create F
__pthread_mutex_destroy F
__pthread_mutex_init F
__pthread_mutex_lock F
__pthread_mutex_trylock F
__pthread_mutex_unlock F
__pthread_mutexattr_destroy F
__pthread_mutexattr_init F
__pthread_mutexattr_settype F
__pthread_once F
__pthread_register_cancel F
__pthread_register_cancel_defer F
__pthread_rwlock_destroy F
__pthread_rwlock_init F
__pthread_rwlock_rdlock F
__pthread_rwlock_tryrdlock F
__pthread_rwlock_trywrlock F
__pthread_rwlock_unlock F
__pthread_rwlock_wrlock F
__pthread_setspecific F
__pthread_unregister_cancel F
__pthread_unregister_cancel_restore F
__pthread_unwind_next F
__pwrite64 F
__read F
__res_state F
__send F
__sigaction F
__vfork F
__wait F
__write F
_pthread_cleanup_pop F
_pthread_cleanup_pop_restore F
_pthread_cleanup_push F
_pthread_cleanup_push_defer F
accept F
close F
connect F
fcntl F
flockfile F
fork F
fsync F
ftrylockfile F
funlockfile F
longjmp F
lseek F
lseek64 F
msync F
nanosleep F
open F
open64 F
pause F
pread F
pread64 F
pthread_attr_destroy F
pthread_attr_getaffinity_np F
pthread_attr_getdetachstate F
pthread_attr_getguardsize F
pthread_attr_getinheritsched F
pthread_attr_getschedparam F
pthread_attr_getschedpolicy F
pthread_attr_getscope F
pthread_attr_getstack F
pthread_attr_getstackaddr F
pthread_attr_getstacksize F
pthread_attr_init F
pthread_attr_setaffinity_np F
pthread_attr_setdetachstate F
pthread_attr_setguardsize F
pthread_attr_setinheritsched F
pthread_attr_setschedparam F
pthread_attr_setschedpolicy F
pthread_attr_setscope F
pthread_attr_setstack F
pthread_attr_setstackaddr F
pthread_attr_setstacksize F
pthread_barrier_destroy F
pthread_barrier_init F
pthread_barrier_wait F
pthread_barrierattr_destroy F
pthread_barrierattr_getpshared F
pthread_barrierattr_init F
pthread_barrierattr_setpshared F
pthread_cancel F
pthread_cond_broadcast F
pthread_cond_destroy F
pthread_cond_init F
pthread_cond_signal F
pthread_cond_timedwait F
pthread_cond_wait F
pthread_condattr_destroy F
pthread_condattr_getclock F
pthread_condattr_getpshared F
pthread_condattr_init F
pthread_condattr_setclock F
pthread_condattr_setpshared F
pthread_create F
pthread_detach F
pthread_equal F
pthread_exit F
pthread_getaffinity_np F
pthread_getattr_np F
pthread_getconcurrency F
pthread_getcpuclockid F
pthread_getschedparam F
pthread_getspecific F
pthread_join F
pthread_key_create F
pthread_key_delete F
pthread_kill F
pthread_kill_other_threads_np F
pthread_mutex_consistent_np F
pthread_mutex_destroy F
pthread_mutex_getprioceiling F
pthread_mutex_init F
pthread_mutex_lock F
pthread_mutex_setprioceiling F
pthread_mutex_timedlock F
pthread_mutex_trylock F
pthread_mutex_unlock F
pthread_mutexattr_destroy F
pthread_mutexattr_getkind_np F
pthread_mutexattr_getprioceiling F
pthread_mutexattr_getprotocol F
pthread_mutexattr_getpshared F
pthread_mutexattr_getrobust_np F
pthread_mutexattr_gettype F
pthread_mutexattr_init F
pthread_mutexattr_setkind_np F
pthread_mutexattr_setprioceiling F
pthread_mutexattr_setprotocol F
pthread_mutexattr_setpshared F
pthread_mutexattr_setrobust_np F
pthread_mutexattr_settype F
pthread_once F
pthread_rwlock_destroy F
pthread_rwlock_init F
pthread_rwlock_rdlock F
pthread_rwlock_timedrdlock F
pthread_rwlock_timedwrlock F
pthread_rwlock_tryrdlock F
pthread_rwlock_trywrlock F
pthread_rwlock_unlock F
pthread_rwlock_wrlock F
pthread_rwlockattr_destroy F
pthread_rwlockattr_getkind_np F
pthread_rwlockattr_getpshared F
pthread_rwlockattr_init F
pthread_rwlockattr_setkind_np F
pthread_rwlockattr_setpshared F
pthread_self F
pthread_setaffinity_np F
pthread_setcancelstate F
pthread_setcanceltype F
pthread_setconcurrency F
pthread_setschedparam F
pthread_setschedprio F
pthread_setspecific F
pthread_sigmask F
pthread_spin_destroy F
pthread_spin_init F
pthread_spin_lock F
pthread_spin_trylock F
pthread_spin_unlock F
pthread_testcancel F
pthread_timedjoin_np F
pthread_tryjoin_np F
pthread_yield F
pwrite F
pwrite64 F
raise F
read F
recv F
recvfrom F
recvmsg F
sem_close F
sem_destroy F
sem_getvalue F
sem_init F
sem_open F
sem_post F
sem_timedwait F
sem_trywait F
sem_unlink F
sem_wait F
send F
sendmsg F
sendto F
sigaction F
siglongjmp F
sigwait F
system F
tcdrain F
vfork F
wait F
waitpid F
write F

View File

@ -0,0 +1,95 @@
GLIBC_2.4
GLIBC_2.4 A
__b64_ntop F
__b64_pton F
__dn_comp F
__dn_count_labels F
__dn_expand F
__dn_skipname F
__fp_nquery F
__fp_query F
__fp_resstat F
__hostalias F
__loc_aton F
__loc_ntoa F
__p_cdname F
__p_cdnname F
__p_class F
__p_class_syms D 0x54
__p_fqname F
__p_fqnname F
__p_option F
__p_query F
__p_rcode F
__p_secstodate F
__p_time F
__p_type F
__p_type_syms D 0x228
__putlong F
__putshort F
__res_close F
__res_dnok F
__res_hnok F
__res_hostalias F
__res_isourserver F
__res_mailok F
__res_mkquery F
__res_nameinquery F
__res_nmkquery F
__res_nquery F
__res_nquerydomain F
__res_nsearch F
__res_nsend F
__res_ownok F
__res_queriesmatch F
__res_query F
__res_querydomain F
__res_search F
__res_send F
__sym_ntop F
__sym_ntos F
__sym_ston F
_gethtbyaddr F
_gethtbyname F
_gethtbyname2 F
_gethtent F
_getlong F
_getshort F
_res_opcodes D 0x40
_sethtent F
inet_net_ntop F
inet_net_pton F
inet_neta F
res_gethostbyaddr F
res_gethostbyname F
res_gethostbyname2 F
res_send_setqhook F
res_send_setrhook F
GLIBC_2.9
GLIBC_2.9 A
ns_datetosecs F
ns_format_ttl F
ns_get16 F
ns_get32 F
ns_initparse F
ns_makecanon F
ns_msg_getflag F
ns_name_compress F
ns_name_ntol F
ns_name_ntop F
ns_name_pack F
ns_name_pton F
ns_name_rollback F
ns_name_skip F
ns_name_uncompress F
ns_name_unpack F
ns_parse_ttl F
ns_parserr F
ns_put16 F
ns_put32 F
ns_samedomain F
ns_samename F
ns_skiprr F
ns_sprintrr F
ns_sprintrrf F
ns_subdomain F

View File

@ -0,0 +1,44 @@
GLIBC_2.4
GLIBC_2.4 A
aio_cancel F
aio_cancel64 F
aio_error F
aio_error64 F
aio_fsync F
aio_fsync64 F
aio_init F
aio_read F
aio_read64 F
aio_return F
aio_return64 F
aio_suspend F
aio_suspend64 F
aio_write F
aio_write64 F
clock_getcpuclockid F
clock_getres F
clock_gettime F
clock_nanosleep F
clock_settime F
lio_listio F
lio_listio64 F
mq_close F
mq_getattr F
mq_notify F
mq_open F
mq_receive F
mq_send F
mq_setattr F
mq_timedreceive F
mq_timedsend F
mq_unlink F
shm_open F
shm_unlink F
timer_create F
timer_delete F
timer_getoverrun F
timer_gettime F
timer_settime F
GLIBC_2.7
GLIBC_2.7 A
__mq_open_2 F

View File

@ -0,0 +1,42 @@
GLIBC_2.4
GLIBC_2.4 A
td_init F
td_log F
td_symbol_list F
td_ta_clear_event F
td_ta_delete F
td_ta_enable_stats F
td_ta_event_addr F
td_ta_event_getmsg F
td_ta_get_nthreads F
td_ta_get_ph F
td_ta_get_stats F
td_ta_map_id2thr F
td_ta_map_lwp2thr F
td_ta_new F
td_ta_reset_stats F
td_ta_set_event F
td_ta_setconcurrency F
td_ta_thr_iter F
td_ta_tsd_iter F
td_thr_clear_event F
td_thr_dbresume F
td_thr_dbsuspend F
td_thr_event_enable F
td_thr_event_getmsg F
td_thr_get_info F
td_thr_getfpregs F
td_thr_getgregs F
td_thr_getxregs F
td_thr_getxregsize F
td_thr_set_event F
td_thr_setfpregs F
td_thr_setgregs F
td_thr_setprio F
td_thr_setsigpending F
td_thr_setxregs F
td_thr_sigsetmask F
td_thr_tls_get_addr F
td_thr_tlsbase F
td_thr_tsd F
td_thr_validate F

View File

@ -0,0 +1,8 @@
GLIBC_2.4
GLIBC_2.4 A
forkpty F
login F
login_tty F
logout F
logwtmp F
openpty F

View File

@ -0,0 +1,13 @@
libc.so: __signbit
libc.so: calloc
libc.so: free
libc.so: fscanf
libc.so: malloc
libc.so: memalign
libc.so: raise
libc.so: realloc
libm.so: __signbit
libm.so: __signbitf
libm.so: matherr
libpthread.so: __errno_location
libpthread.so: raise

View File

@ -0,0 +1,132 @@
/* low level locking for pthread library. Generic futex-using version.
Copyright (C) 2003-2014 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 <errno.h>
#include <sysdep.h>
#include <lowlevellock.h>
#include <sys/time.h>
void
__lll_lock_wait_private (int *futex)
{
do
{
int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
if (oldval != 0)
lll_futex_wait (futex, 2, LLL_PRIVATE);
}
while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
}
/* These functions don't get included in libc.so */
#ifdef IS_IN_libpthread
void
__lll_lock_wait (int *futex, int private)
{
do
{
int oldval = atomic_compare_and_exchange_val_acq (futex, 2, 1);
if (oldval != 0)
lll_futex_wait (futex, 2, private);
}
while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
}
int
__lll_timedlock_wait (int *futex, const struct timespec *abstime, int private)
{
struct timespec rt;
/* Reject invalid timeouts. */
if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
return EINVAL;
/* Upgrade the lock. */
if (atomic_exchange_acq (futex, 2) == 0)
return 0;
do
{
struct timeval tv;
/* Get the current time. */
(void) __gettimeofday (&tv, NULL);
/* Compute relative timeout. */
rt.tv_sec = abstime->tv_sec - tv.tv_sec;
rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
if (rt.tv_nsec < 0)
{
rt.tv_nsec += 1000000000;
--rt.tv_sec;
}
/* Already timed out? */
if (rt.tv_sec < 0)
return ETIMEDOUT;
// XYZ: Lost the lock to check whether it was private.
lll_futex_timed_wait (futex, 2, &rt, private);
}
while (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0);
return 0;
}
int
__lll_timedwait_tid (int *tidp, const struct timespec *abstime)
{
int tid;
if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
return EINVAL;
/* Repeat until thread terminated. */
while ((tid = *tidp) != 0)
{
struct timeval tv;
struct timespec rt;
/* Get the current time. */
(void) __gettimeofday (&tv, NULL);
/* Compute relative timeout. */
rt.tv_sec = abstime->tv_sec - tv.tv_sec;
rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
if (rt.tv_nsec < 0)
{
rt.tv_nsec += 1000000000;
--rt.tv_sec;
}
/* Already timed out? */
if (rt.tv_sec < 0)
return ETIMEDOUT;
/* Wait until thread terminates. */
// XYZ: Lost the lock to check whether it was private.
if (lll_futex_timed_wait (tidp, tid, &rt, LLL_SHARED) == -ETIMEDOUT)
return ETIMEDOUT;
}
return 0;
}
#endif

View File

@ -0,0 +1,321 @@
/* Copyright (C) 2005-2014 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/>. */
#ifndef _LOWLEVELLOCK_H
#define _LOWLEVELLOCK_H 1
#include <time.h>
#include <sys/param.h>
#include <bits/pthreadtypes.h>
#include <atomic.h>
#include <sysdep.h>
#include <kernel-features.h>
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#define FUTEX_REQUEUE 3
#define FUTEX_CMP_REQUEUE 4
#define FUTEX_WAKE_OP 5
#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1)
#define FUTEX_LOCK_PI 6
#define FUTEX_UNLOCK_PI 7
#define FUTEX_TRYLOCK_PI 8
#define FUTEX_WAIT_BITSET 9
#define FUTEX_WAKE_BITSET 10
#define FUTEX_WAIT_REQUEUE_PI 11
#define FUTEX_CMP_REQUEUE_PI 12
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_CLOCK_REALTIME 256
#define FUTEX_BITSET_MATCH_ANY 0xffffffff
/* Values for 'private' parameter of locking macros. Yes, the
definition seems to be backwards. But it is not. The bit will be
reversed before passing to the system call. */
#define LLL_PRIVATE 0
#define LLL_SHARED FUTEX_PRIVATE_FLAG
#if !defined NOT_IN_libc || defined IS_IN_rtld
/* In libc.so or ld.so all futexes are private. */
# ifdef __ASSUME_PRIVATE_FUTEX
# define __lll_private_flag(fl, private) \
((fl) | FUTEX_PRIVATE_FLAG)
# else
# define __lll_private_flag(fl, private) \
((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex))
# endif
#else
# ifdef __ASSUME_PRIVATE_FUTEX
# define __lll_private_flag(fl, private) \
(((fl) | FUTEX_PRIVATE_FLAG) ^ (private))
# else
# define __lll_private_flag(fl, private) \
(__builtin_constant_p (private) \
? ((private) == 0 \
? ((fl) | THREAD_GETMEM (THREAD_SELF, header.private_futex)) \
: (fl)) \
: ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG) \
& THREAD_GETMEM (THREAD_SELF, header.private_futex))))
# endif
#endif
#define lll_futex_wait(futexp, val, private) \
lll_futex_timed_wait(futexp, val, NULL, private)
#define lll_futex_timed_wait(futexp, val, timespec, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
__ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
__lll_private_flag (FUTEX_WAIT, private), \
(val), (timespec)); \
__ret; \
})
#define lll_futex_timed_wait_bitset(futexp, val, timespec, clockbit, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
int __op = FUTEX_WAIT_BITSET | clockbit; \
__ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
__lll_private_flag (__op, private), \
(val), (timespec), NULL /* Unused. */, \
FUTEX_BITSET_MATCH_ANY); \
__ret; \
})
#define lll_futex_wake(futexp, nr, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
__ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
__lll_private_flag (FUTEX_WAKE, private), \
(nr), 0); \
__ret; \
})
#define lll_robust_dead(futexv, private) \
do \
{ \
int *__futexp = &(futexv); \
atomic_or (__futexp, FUTEX_OWNER_DIED); \
lll_futex_wake (__futexp, 1, private); \
} \
while (0)
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
__ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
__lll_private_flag (FUTEX_CMP_REQUEUE, private),\
(nr_wake), (nr_move), (mutex), (val)); \
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
/* Returns non-zero if error happened, zero if success. */
#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
__ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
__lll_private_flag (FUTEX_WAKE_OP, private), \
(nr_wake), (nr_wake2), (futexp2), \
FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
/* Priority Inheritance support. */
#define lll_futex_wait_requeue_pi(futexp, val, mutex, private) \
lll_futex_timed_wait_requeue_pi (futexp, val, NULL, 0, mutex, private)
#define lll_futex_timed_wait_requeue_pi(futexp, val, timespec, clockbit, \
mutex, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
int __op = FUTEX_WAIT_REQUEUE_PI | clockbit; \
\
INTERNAL_SYSCALL (futex, __err, 5, (futexp), \
__lll_private_flag (__op, private), \
(val), (timespec), mutex); \
})
#define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
\
__ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
__lll_private_flag (FUTEX_CMP_REQUEUE_PI, priv),\
(nr_wake), (nr_move), (mutex), (val)); \
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
#define lll_trylock(lock) \
atomic_compare_and_exchange_val_acq(&(lock), 1, 0)
#define lll_cond_trylock(lock) \
atomic_compare_and_exchange_val_acq(&(lock), 2, 0)
#define __lll_robust_trylock(futex, id) \
(atomic_compare_and_exchange_val_acq (futex, id, 0) != 0)
#define lll_robust_trylock(lock, id) \
__lll_robust_trylock (&(lock), id)
extern void __lll_lock_wait_private (int *futex) attribute_hidden;
extern void __lll_lock_wait (int *futex, int private) attribute_hidden;
extern int __lll_robust_lock_wait (int *futex, int private) attribute_hidden;
#define __lll_lock(futex, private) \
((void) ({ \
int *__futex = (futex); \
if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex, \
1, 0), 0)) \
{ \
if (__builtin_constant_p (private) && (private) == LLL_PRIVATE) \
__lll_lock_wait_private (__futex); \
else \
__lll_lock_wait (__futex, private); \
} \
}))
#define lll_lock(futex, private) __lll_lock (&(futex), private)
#define __lll_robust_lock(futex, id, private) \
({ \
int *__futex = (futex); \
int __val = 0; \
\
if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \
0), 0)) \
__val = __lll_robust_lock_wait (__futex, private); \
__val; \
})
#define lll_robust_lock(futex, id, private) \
__lll_robust_lock (&(futex), id, private)
#define __lll_cond_lock(futex, private) \
((void) ({ \
int *__futex = (futex); \
if (__builtin_expect (atomic_exchange_acq (__futex, 2), 0)) \
__lll_lock_wait (__futex, private); \
}))
#define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
#define lll_robust_cond_lock(futex, id, private) \
__lll_robust_lock (&(futex), (id) | FUTEX_WAITERS, private)
extern int __lll_timedlock_wait (int *futex, const struct timespec *,
int private) attribute_hidden;
extern int __lll_robust_timedlock_wait (int *futex, const struct timespec *,
int private) attribute_hidden;
#define __lll_timedlock(futex, abstime, private) \
({ \
int *__futex = (futex); \
int __val = 0; \
\
if (__builtin_expect (atomic_exchange_acq (__futex, 1), 0)) \
__val = __lll_timedlock_wait (__futex, abstime, private); \
__val; \
})
#define lll_timedlock(futex, abstime, private) \
__lll_timedlock (&(futex), abstime, private)
#define __lll_robust_timedlock(futex, abstime, id, private) \
({ \
int *__futex = (futex); \
int __val = 0; \
\
if (__builtin_expect (atomic_compare_and_exchange_bool_acq (__futex, id, \
0), 0)) \
__val = __lll_robust_timedlock_wait (__futex, abstime, private); \
__val; \
})
#define lll_robust_timedlock(futex, abstime, id, private) \
__lll_robust_timedlock (&(futex), abstime, id, private)
#define __lll_unlock(futex, private) \
(void) \
({ int *__futex = (futex); \
int __oldval = atomic_exchange_rel (__futex, 0); \
if (__builtin_expect (__oldval > 1, 0)) \
lll_futex_wake (__futex, 1, private); \
})
#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
#define __lll_robust_unlock(futex, private) \
(void) \
({ int *__futex = (futex); \
int __oldval = atomic_exchange_rel (__futex, 0); \
if (__builtin_expect (__oldval & FUTEX_WAITERS, 0)) \
lll_futex_wake (__futex, 1, private); \
})
#define lll_robust_unlock(futex, private) \
__lll_robust_unlock(&(futex), private)
#define lll_islocked(futex) \
(futex != 0)
/* Our internal lock implementation is identical to the binary-compatible
mutex implementation. */
/* Initializers for lock. */
#define LLL_LOCK_INITIALIZER (0)
#define LLL_LOCK_INITIALIZER_LOCKED (1)
/* The states of a lock are:
0 - untaken
1 - taken by one user
>1 - taken by more users */
/* 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. */
#define lll_wait_tid(tid) \
do { \
__typeof (tid) __tid; \
while ((__tid = (tid)) != 0) \
lll_futex_wait (&(tid), __tid, LLL_SHARED);\
} while (0)
extern int __lll_timedwait_tid (int *, const struct timespec *)
attribute_hidden;
#define lll_timedwait_tid(tid, abstime) \
({ \
int __res = 0; \
if ((tid) != 0) \
__res = __lll_timedwait_tid (&(tid), (abstime)); \
__res; \
})
#endif /* lowlevellock.h */

View File

@ -0,0 +1 @@
#include <aeabi_unwind_cpp_pr1.c>

View File

@ -0,0 +1,34 @@
/* Copyright (C) 2005-2014 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 <tcb-offsets.h>
/* Save the PID value. */
#define SAVE_PID \
GET_TLS (r2); \
NEGOFF_ADJ_BASE2 (r2, r0, PID_OFFSET); /* Save the TLS addr in r2. */ \
ldr r3, NEGOFF_OFF1 (r2, PID_OFFSET); /* Load the saved PID. */ \
rsb r0, r3, #0; /* Negate it. */ \
str r0, NEGOFF_OFF1 (r2, PID_OFFSET); /* Store the temp PID. */
/* Restore the old PID value in the parent. */
#define RESTORE_PID \
cmp r0, #0; /* If we are the parent... */ \
it ne; \
strne r3, NEGOFF_OFF1 (r2, PID_OFFSET); /* restore the saved PID. */
#include "../vfork.S"

View File

@ -0,0 +1,89 @@
/* Copyright (C) 2004-2014 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 "pthreadP.h"
#include <lowlevellock.h>
unsigned long int __fork_generation attribute_hidden;
static void
clear_once_control (void *arg)
{
pthread_once_t *once_control = (pthread_once_t *) arg;
*once_control = 0;
lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
}
int
__pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
{
for (;;)
{
int oldval;
int newval;
/* Pseudo code:
newval = __fork_generation | 1;
oldval = *once_control;
if ((oldval & 2) == 0)
*once_control = newval;
Do this atomically.
*/
do
{
newval = __fork_generation | 1;
oldval = *once_control;
if (oldval & 2)
break;
} while (atomic_compare_and_exchange_val_acq (once_control, newval, oldval) != oldval);
/* Check if the initializer has already been done. */
if ((oldval & 2) != 0)
return 0;
/* Check if another thread already runs the initializer. */
if ((oldval & 1) == 0)
break;
/* Check whether the initializer execution was interrupted by a fork. */
if (oldval != newval)
break;
/* Same generation, some other thread was faster. Wait. */
lll_futex_wait (once_control, oldval, LLL_PRIVATE);
}
/* This thread is the first here. Do the initialization.
Register a cleanup handler so that in case the thread gets
interrupted the initialization can be restarted. */
pthread_cleanup_push (clear_once_control, once_control);
init_routine ();
pthread_cleanup_pop (0);
/* Say that the initialisation is done. */
*once_control = __fork_generation | 2;
/* Wake up all other threads. */
lll_futex_wake (once_control, INT_MAX, LLL_PRIVATE);
return 0;
}
weak_alias (__pthread_once, pthread_once)
hidden_def (__pthread_once)

View File

@ -0,0 +1 @@
#include <aeabi_unwind_cpp_pr1.c>

View File

@ -0,0 +1,242 @@
/* Copyright (C) 2003-2014 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 <sysdep.h>
#include <tls.h>
#ifndef __ASSEMBLER__
# include <nptl/pthreadP.h>
#endif
#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
/* NOTE: We do mark syscalls with unwind annotations, for the benefit of
cancellation; but they're really only accurate at the point of the
syscall. The ARM unwind directives are not rich enough without adding
a custom personality function. */
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
.text; \
ENTRY (__##syscall_name##_nocancel); \
CFI_SECTIONS; \
DO_CALL (syscall_name, args); \
cmn r0, $4096; \
PSEUDO_RET; \
END (__##syscall_name##_nocancel); \
ENTRY (name); \
SINGLE_THREAD_P; \
DOARGS_##args; \
bne .Lpseudo_cancel; \
cfi_remember_state; \
ldr r7, =SYS_ify (syscall_name); \
swi 0x0; \
UNDOARGS_##args; \
cmn r0, $4096; \
PSEUDO_RET; \
cfi_restore_state; \
.Lpseudo_cancel: \
.fnstart; /* matched by the .fnend in UNDOARGS below. */ \
DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
CENABLE; \
mov ip, r0; /* put mask in safe place. */ \
UNDOCARGS_##args; /* restore syscall args. */ \
ldr r7, =SYS_ify (syscall_name); \
swi 0x0; /* do the call. */ \
mov r7, r0; /* save syscall return value. */ \
mov r0, ip; /* get mask back. */ \
CDISABLE; \
mov r0, r7; /* retrieve return value. */ \
RESTORE_LR_##args; \
UNDOARGS_##args; \
cmn r0, $4096
/* DOARGS pushes eight bytes on the stack for five arguments, twelve bytes for
six arguments, and four bytes for fewer. In order to preserve doubleword
alignment, sometimes we must save an extra register. */
# define RESTART_UNWIND \
.fnend; \
.fnstart; \
.save {r7}; \
.save {lr}
# define DOCARGS_0 \
.save {r7}; \
push {lr}; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (lr, 0); \
.save {lr}
# define UNDOCARGS_0
# define RESTORE_LR_0 \
pop {lr}; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (lr)
# define DOCARGS_1 \
.save {r7}; \
push {r0, r1, lr}; \
cfi_adjust_cfa_offset (12); \
cfi_rel_offset (lr, 8); \
.save {lr}; \
.pad #8
# define UNDOCARGS_1 \
ldr r0, [sp], #8; \
cfi_adjust_cfa_offset (-8); \
RESTART_UNWIND
# define RESTORE_LR_1 \
RESTORE_LR_0
# define DOCARGS_2 \
.save {r7}; \
push {r0, r1, lr}; \
cfi_adjust_cfa_offset (12); \
cfi_rel_offset (lr, 8); \
.save {lr}; \
.pad #8
# define UNDOCARGS_2 \
pop {r0, r1}; \
cfi_adjust_cfa_offset (-8); \
RESTART_UNWIND
# define RESTORE_LR_2 \
RESTORE_LR_0
# define DOCARGS_3 \
.save {r7}; \
push {r0, r1, r2, r3, lr}; \
cfi_adjust_cfa_offset (20); \
cfi_rel_offset (lr, 16); \
.save {lr}; \
.pad #16
# define UNDOCARGS_3 \
pop {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
RESTART_UNWIND
# define RESTORE_LR_3 \
RESTORE_LR_0
# define DOCARGS_4 \
.save {r7}; \
push {r0, r1, r2, r3, lr}; \
cfi_adjust_cfa_offset (20); \
cfi_rel_offset (lr, 16); \
.save {lr}; \
.pad #16
# define UNDOCARGS_4 \
pop {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
RESTART_UNWIND
# define RESTORE_LR_4 \
RESTORE_LR_0
/* r4 is only stmfd'ed for correct stack alignment. */
# define DOCARGS_5 \
.save {r4, r7}; \
push {r0, r1, r2, r3, r4, lr}; \
cfi_adjust_cfa_offset (24); \
cfi_rel_offset (lr, 20); \
.save {lr}; \
.pad #20
# define UNDOCARGS_5 \
pop {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
.fnend; \
.fnstart; \
.save {r4, r7}; \
.save {lr}; \
.pad #4
# define RESTORE_LR_5 \
pop {r4, lr}; \
cfi_adjust_cfa_offset (-8); \
/* r4 will be marked as restored later. */ \
cfi_restore (lr)
# define DOCARGS_6 \
.save {r4, r5, r7}; \
push {r0, r1, r2, r3, lr}; \
cfi_adjust_cfa_offset (20); \
cfi_rel_offset (lr, 16); \
.save {lr}; \
.pad #16
# define UNDOCARGS_6 \
pop {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
.fnend; \
.fnstart; \
.save {r4, r5, r7}; \
.save {lr};
# define RESTORE_LR_6 \
RESTORE_LR_0
# ifdef IS_IN_libpthread
# define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
# define CDISABLE bl PLTJMP(__pthread_disable_asynccancel)
# define __local_multiple_threads __pthread_multiple_threads
# elif !defined NOT_IN_libc
# define CENABLE bl PLTJMP(__libc_enable_asynccancel)
# define CDISABLE bl PLTJMP(__libc_disable_asynccancel)
# define __local_multiple_threads __libc_multiple_threads
# elif defined IS_IN_librt
# define CENABLE bl PLTJMP(__librt_enable_asynccancel)
# define CDISABLE bl PLTJMP(__librt_disable_asynccancel)
# else
# error Unsupported library
# endif
# if defined IS_IN_libpthread || !defined NOT_IN_libc
# ifndef __ASSEMBLER__
extern int __local_multiple_threads attribute_hidden;
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
# else
# define SINGLE_THREAD_P \
LDST_PCREL(ldr, ip, ip, __local_multiple_threads); \
teq ip, #0
# endif
# else
/* There is no __local_multiple_threads for librt, so use the TCB. */
# ifndef __ASSEMBLER__
# define SINGLE_THREAD_P \
__builtin_expect (THREAD_GETMEM (THREAD_SELF, \
header.multiple_threads) == 0, 1)
# else
# define SINGLE_THREAD_P \
push {r0, lr}; \
cfi_adjust_cfa_offset (8); \
cfi_rel_offset (lr, 4); \
GET_TLS (lr); \
NEGOFF_ADJ_BASE (r0, MULTIPLE_THREADS_OFFSET); \
ldr ip, NEGOFF_OFF1 (r0, MULTIPLE_THREADS_OFFSET); \
pop {r0, lr}; \
cfi_adjust_cfa_offset (-8); \
cfi_restore (lr); \
teq ip, #0
# define SINGLE_THREAD_P_PIC(x) SINGLE_THREAD_P
# endif
# endif
#elif !defined __ASSEMBLER__
/* For rtld, et cetera. */
# define SINGLE_THREAD_P 1
# define NO_CANCELLATION 1
#endif
#ifndef __ASSEMBLER__
# define RTLD_SINGLE_THREAD_P \
__builtin_expect (THREAD_GETMEM (THREAD_SELF, \
header.multiple_threads) == 0, 1)
#endif

View File

@ -0,0 +1,157 @@
/* Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
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 <dlfcn.h>
#include <stdio.h>
#include <unwind.h>
#include <pthreadP.h>
static void *libgcc_s_handle;
static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
static _Unwind_Reason_Code (*libgcc_s_personality)
(_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
static _Unwind_Word (*libgcc_s_getcfa) (struct _Unwind_Context *);
void
__attribute_noinline__
pthread_cancel_init (void)
{
void *resume, *personality, *forcedunwind, *getcfa;
void *handle;
if (__builtin_expect (libgcc_s_handle != NULL, 1))
{
/* Force gcc to reload all values. */
asm volatile ("" ::: "memory");
return;
}
handle = __libc_dlopen ("libgcc_s.so.1");
if (handle == NULL
|| (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
|| (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL
|| (forcedunwind = __libc_dlsym (handle, "_Unwind_ForcedUnwind"))
== NULL
|| (getcfa = __libc_dlsym (handle, "_Unwind_GetCFA")) == NULL
#ifdef ARCH_CANCEL_INIT
|| ARCH_CANCEL_INIT (handle)
#endif
)
__libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n");
libgcc_s_resume = resume;
libgcc_s_personality = personality;
libgcc_s_forcedunwind = forcedunwind;
libgcc_s_getcfa = getcfa;
/* Make sure libgcc_s_getcfa is written last. Otherwise,
pthread_cancel_init might return early even when the pointer the
caller is interested in is not initialized yet. */
atomic_write_barrier ();
libgcc_s_handle = handle;
}
void
__libc_freeres_fn_section
__unwind_freeres (void)
{
void *handle = libgcc_s_handle;
if (handle != NULL)
{
libgcc_s_handle = NULL;
__libc_dlclose (handle);
}
}
/* It's vitally important that _Unwind_Resume not have a stack frame; the
ARM unwinder relies on register state at entrance. So we write this in
assembly. */
#define STR1(S) #S
#define STR(S) STR1(S)
asm (
" .globl _Unwind_Resume\n"
" .type _Unwind_Resume, %function\n"
"_Unwind_Resume:\n"
" .cfi_sections .debug_frame\n"
" " CFI_STARTPROC "\n"
" push {r4, r5, r6, lr}\n"
" " CFI_ADJUST_CFA_OFFSET (16)" \n"
" " CFI_REL_OFFSET (r4, 0) "\n"
" " CFI_REL_OFFSET (r5, 4) "\n"
" " CFI_REL_OFFSET (r6, 8) "\n"
" " CFI_REL_OFFSET (lr, 12) "\n"
" " CFI_REMEMBER_STATE "\n"
" ldr r4, 1f\n"
" ldr r5, 2f\n"
"3: add r4, pc, r4\n"
" ldr r3, [r4, r5]\n"
" mov r6, r0\n"
" cmp r3, #0\n"
" beq 4f\n"
"5: mov r0, r6\n"
" pop {r4, r5, r6, lr}\n"
" " CFI_ADJUST_CFA_OFFSET (-16) "\n"
" " CFI_RESTORE (r4) "\n"
" " CFI_RESTORE (r5) "\n"
" " CFI_RESTORE (r6) "\n"
" " CFI_RESTORE (lr) "\n"
" bx r3\n"
" " CFI_RESTORE_STATE "\n"
"4: bl pthread_cancel_init\n"
" ldr r3, [r4, r5]\n"
" b 5b\n"
" " CFI_ENDPROC "\n"
" .align 2\n"
"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - " STR (PC_OFS) "\n"
"2: .word libgcc_s_resume(GOTOFF)\n"
" .size _Unwind_Resume, .-_Unwind_Resume\n"
);
_Unwind_Reason_Code
__gcc_personality_v0 (_Unwind_State state,
struct _Unwind_Exception *ue_header,
struct _Unwind_Context *context)
{
if (__builtin_expect (libgcc_s_personality == NULL, 0))
pthread_cancel_init ();
return libgcc_s_personality (state, ue_header, context);
}
_Unwind_Reason_Code
_Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop,
void *stop_argument)
{
if (__builtin_expect (libgcc_s_forcedunwind == NULL, 0))
pthread_cancel_init ();
return libgcc_s_forcedunwind (exc, stop, stop_argument);
}
_Unwind_Word
_Unwind_GetCFA (struct _Unwind_Context *context)
{
if (__builtin_expect (libgcc_s_getcfa == NULL, 0))
pthread_cancel_init ();
return libgcc_s_getcfa (context);
}

View File

@ -0,0 +1,100 @@
/* Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
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 <dlfcn.h>
#include <stdio.h>
#include <unwind.h>
static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
static _Unwind_Reason_Code (*libgcc_s_personality)
(_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
static void init (void) __attribute_used__;
static void
init (void)
{
void *resume, *personality;
void *handle;
handle = __libc_dlopen ("libgcc_s.so.1");
if (handle == NULL
|| (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
|| (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL)
__libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n");
libgcc_s_resume = resume;
libgcc_s_personality = personality;
}
/* It's vitally important that _Unwind_Resume not have a stack frame; the
ARM unwinder relies on register state at entrance. So we write this in
assembly. */
#define STR1(S) #S
#define STR(S) STR1(S)
asm (
" .globl _Unwind_Resume\n"
" .type _Unwind_Resume, %function\n"
"_Unwind_Resume:\n"
" .cfi_sections .debug_frame\n"
" " CFI_STARTPROC "\n"
" push {r4, r5, r6, lr}\n"
" " CFI_ADJUST_CFA_OFFSET (16)" \n"
" " CFI_REL_OFFSET (r4, 0) "\n"
" " CFI_REL_OFFSET (r5, 4) "\n"
" " CFI_REL_OFFSET (r6, 8) "\n"
" " CFI_REL_OFFSET (lr, 12) "\n"
" " CFI_REMEMBER_STATE "\n"
" ldr r4, 1f\n"
" ldr r5, 2f\n"
"3: add r4, pc, r4\n"
" ldr r3, [r4, r5]\n"
" mov r6, r0\n"
" cmp r3, #0\n"
" beq 4f\n"
"5: mov r0, r6\n"
" pop {r4, r5, r6, lr}\n"
" " CFI_ADJUST_CFA_OFFSET (-16) "\n"
" " CFI_RESTORE (r4) "\n"
" " CFI_RESTORE (r5) "\n"
" " CFI_RESTORE (r6) "\n"
" " CFI_RESTORE (lr) "\n"
" bx r3\n"
" " CFI_RESTORE_STATE "\n"
"4: bl init\n"
" ldr r3, [r4, r5]\n"
" b 5b\n"
" " CFI_ENDPROC "\n"
" .align 2\n"
"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - " STR (PC_OFS) "\n"
"2: .word libgcc_s_resume(GOTOFF)\n"
" .size _Unwind_Resume, .-_Unwind_Resume\n"
);
_Unwind_Reason_Code
__gcc_personality_v0 (_Unwind_State state,
struct _Unwind_Exception *ue_header,
struct _Unwind_Context *context)
{
if (__builtin_expect (libgcc_s_personality == NULL, 0))
init ();
return libgcc_s_personality (state, ue_header, context);
}

View File

@ -0,0 +1,278 @@
/* Header file for the ARM EABI unwinder
Copyright (C) 2003-2014 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
This file 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
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>. */
/* Language-independent unwinder header public defines. This contains both
ABI defined objects, and GNU support routines. */
#ifndef UNWIND_ARM_H
#define UNWIND_ARM_H
#define __ARM_EABI_UNWINDER__ 1
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
typedef _Unwind_Word _uw;
typedef unsigned _uw64 __attribute__((mode(__DI__)));
typedef unsigned _uw16 __attribute__((mode(__HI__)));
typedef unsigned _uw8 __attribute__((mode(__QI__)));
typedef enum
{
_URC_OK = 0, /* operation completed successfully */
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
_URC_END_OF_STACK = 5,
_URC_HANDLER_FOUND = 6,
_URC_INSTALL_CONTEXT = 7,
_URC_CONTINUE_UNWIND = 8,
_URC_FAILURE = 9 /* unspecified failure of some kind */
}
_Unwind_Reason_Code;
typedef enum
{
_US_VIRTUAL_UNWIND_FRAME = 0,
_US_UNWIND_FRAME_STARTING = 1,
_US_UNWIND_FRAME_RESUME = 2,
_US_ACTION_MASK = 3,
_US_FORCE_UNWIND = 8,
_US_END_OF_STACK = 16
}
_Unwind_State;
/* Provided only for for compatibility with existing code. */
typedef int _Unwind_Action;
#define _UA_SEARCH_PHASE 1
#define _UA_CLEANUP_PHASE 2
#define _UA_HANDLER_FRAME 4
#define _UA_FORCE_UNWIND 8
#define _UA_END_OF_STACK 16
#define _URC_NO_REASON _URC_OK
typedef struct _Unwind_Control_Block _Unwind_Control_Block;
typedef struct _Unwind_Context _Unwind_Context;
typedef _uw _Unwind_EHT_Header;
/* UCB: */
struct _Unwind_Control_Block
{
#ifdef _LIBC
/* For the benefit of code which assumes this is a scalar. All
glibc ever does is clear it. */
_uw64 exception_class;
#else
char exception_class[8];
#endif
void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
/* Unwinder cache, private fields for the unwinder's use */
struct
{
_uw reserved1; /* Forced unwind stop fn, 0 if not forced */
_uw reserved2; /* Personality routine address */
_uw reserved3; /* Saved callsite address */
_uw reserved4; /* Forced unwind stop arg */
_uw reserved5;
}
unwinder_cache;
/* Propagation barrier cache (valid after phase 1): */
struct
{
_uw sp;
_uw bitpattern[5];
}
barrier_cache;
/* Cleanup cache (preserved over cleanup): */
struct
{
_uw bitpattern[4];
}
cleanup_cache;
/* Pr cache (for pr's benefit): */
struct
{
_uw fnstart; /* function start address */
_Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */
_uw additional; /* additional data */
_uw reserved1;
}
pr_cache;
long long int :0; /* Force alignment to 8-byte boundary */
};
/* Virtual Register Set*/
typedef enum
{
_UVRSC_CORE = 0, /* integer register */
_UVRSC_VFP = 1, /* vfp */
_UVRSC_FPA = 2, /* fpa */
_UVRSC_WMMXD = 3, /* Intel WMMX data register */
_UVRSC_WMMXC = 4 /* Intel WMMX control register */
}
_Unwind_VRS_RegClass;
typedef enum
{
_UVRSD_UINT32 = 0,
_UVRSD_VFPX = 1,
_UVRSD_FPAX = 2,
_UVRSD_UINT64 = 3,
_UVRSD_FLOAT = 4,
_UVRSD_DOUBLE = 5
}
_Unwind_VRS_DataRepresentation;
typedef enum
{
_UVRSR_OK = 0,
_UVRSR_NOT_IMPLEMENTED = 1,
_UVRSR_FAILED = 2
}
_Unwind_VRS_Result;
/* Frame unwinding state. */
typedef struct
{
/* The current word (bytes packed msb first). */
_uw data;
/* Pointer to the next word of data. */
_uw *next;
/* The number of bytes left in this word. */
_uw8 bytes_left;
/* The number of words pointed to by ptr. */
_uw8 words_left;
}
__gnu_unwind_state;
typedef _Unwind_Reason_Code (*personality_routine) (_Unwind_State,
_Unwind_Control_Block *, _Unwind_Context *);
_Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *, _Unwind_VRS_RegClass,
_uw, _Unwind_VRS_DataRepresentation,
void *);
_Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *, _Unwind_VRS_RegClass,
_uw, _Unwind_VRS_DataRepresentation,
void *);
_Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *, _Unwind_VRS_RegClass,
_uw, _Unwind_VRS_DataRepresentation);
/* Support functions for the PR. */
#define _Unwind_Exception _Unwind_Control_Block
typedef char _Unwind_Exception_Class[8];
void * _Unwind_GetLanguageSpecificData (_Unwind_Context *);
_Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *);
/* These two should never be used. */
_Unwind_Ptr _Unwind_GetDataRelBase (_Unwind_Context *);
_Unwind_Ptr _Unwind_GetTextRelBase (_Unwind_Context *);
/* Interface functions: */
_Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp);
void __attribute__((noreturn)) _Unwind_Resume(_Unwind_Control_Block *ucbp);
_Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Control_Block *ucbp);
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
(int, _Unwind_Action, _Unwind_Exception_Class,
_Unwind_Control_Block *, struct _Unwind_Context *, void *);
_Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Control_Block *,
_Unwind_Stop_Fn, void *);
_Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
void _Unwind_Complete(_Unwind_Control_Block *ucbp);
void _Unwind_DeleteException (_Unwind_Exception *);
_Unwind_Reason_Code __gnu_unwind_frame (_Unwind_Control_Block *,
_Unwind_Context *);
_Unwind_Reason_Code __gnu_unwind_execute (_Unwind_Context *,
__gnu_unwind_state *);
/* Decode an R_ARM_TARGET2 relocation. */
static inline _Unwind_Word
_Unwind_decode_target2 (_Unwind_Word ptr)
{
_Unwind_Word tmp;
tmp = *(_Unwind_Word *) ptr;
/* Zero values are always NULL. */
if (!tmp)
return 0;
#if defined(linux) || defined(__NetBSD__)
/* Pc-relative indirect. */
tmp += ptr;
tmp = *(_Unwind_Word *) tmp;
#elif defined(__symbian__)
/* Absolute pointer. Nothing more to do. */
#else
/* Pc-relative pointer. */
tmp += ptr;
#endif
return tmp;
}
static inline _Unwind_Word
_Unwind_GetGR (_Unwind_Context *context, int regno)
{
_uw val;
_Unwind_VRS_Get (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
return val;
}
/* Return the address of the instruction, not the actual IP value. */
#define _Unwind_GetIP(context) \
(_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
static inline void
_Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val)
{
_Unwind_VRS_Set (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
}
/* The dwarf unwinder doesn't understand arm/thumb state. We assume the
landing pad uses the same instruction set as the call site. */
#define _Unwind_SetIP(context, val) \
_Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1))
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
(struct _Unwind_Context *, void *);
extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* defined UNWIND_ARM_H */

View File

@ -0,0 +1,36 @@
/* Copyright (C) 2005-2014 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 <tcb-offsets.h>
/* Save the PID value. */
#define SAVE_PID \
GET_TLS (r2); \
NEGOFF_ADJ_BASE2 (r2, r0, PID_OFFSET); /* Save the TLS addr in r2. */ \
ldr r3, NEGOFF_OFF1 (r2, PID_OFFSET); /* Load the saved PID. */ \
rsbs r0, r3, #0; /* Negate it. */ \
it eq; \
moveq r0, #0x80000000; /* Use 0x80000000 if it was 0. */ \
str r0, NEGOFF_OFF1 (r2, PID_OFFSET); /* Store the temp PID. */
/* Restore the old PID value in the parent. */
#define RESTORE_PID \
cmp r0, #0; /* If we are the parent... */ \
it ne; \
strne r3, NEGOFF_OFF1 (r2, PID_OFFSET); /* restore the saved PID. */
#include "../vfork.S"

View File

@ -0,0 +1 @@
/* Empty. */

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/oldgetrlimit64.c>

View File

@ -0,0 +1 @@
/* Empty. */

View File

@ -0,0 +1,30 @@
/* Copyright (C) 2005-2014 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 <fcntl.h>
int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise);
/* Advice the system about the expected behaviour of the application with
respect to the file associated with FD. */
int
posix_fadvise (int fd, off_t offset, off_t len, int advise)
{
/* ARM only has a syscall for fadvise64_64. */
return __posix_fadvise64_l64 (fd, offset, len, advise);
}

View File

@ -0,0 +1,55 @@
/* Copyright (C) 2003-2014 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 <errno.h>
#include <fcntl.h>
#include <sysdep.h>
int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise);
int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise);
/* Advice the system about the expected behaviour of the application with
respect to the file associated with FD. */
int
__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
{
INTERNAL_SYSCALL_DECL (err);
int ret = INTERNAL_SYSCALL (arm_fadvise64_64, err, 6, fd, advise,
__LONG_LONG_PAIR ((long)(offset >> 32), (long)offset),
__LONG_LONG_PAIR ((long)(len >> 32), (long)len));
if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
return 0;
return INTERNAL_SYSCALL_ERRNO (ret, err);
}
#include <shlib-compat.h>
#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
int
attribute_compat_text_section
__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
{
return __posix_fadvise64_l64 (fd, offset, len, advise);
}
versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
#else
strong_alias (__posix_fadvise64_l64, posix_fadvise64);
#endif

View File

@ -0,0 +1,58 @@
/* Copyright (C) 1997-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
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 <errno.h>
#include <endian.h>
#include <unistd.h>
#include <sysdep-cancel.h>
#include <sys/syscall.h>
ssize_t
__libc_pread (fd, buf, count, offset)
int fd;
void *buf;
size_t count;
off_t offset;
{
ssize_t result;
if (SINGLE_THREAD_P)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
LIBC_CANCEL_RESET (oldtype);
return result;
}
strong_alias (__libc_pread, __pread)
weak_alias (__libc_pread, pread)

View File

@ -0,0 +1,60 @@
/* Copyright (C) 1997-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
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 <errno.h>
#include <endian.h>
#include <unistd.h>
#include <sysdep-cancel.h>
#include <sys/syscall.h>
ssize_t
__libc_pread64 (fd, buf, count, offset)
int fd;
void *buf;
size_t count;
off64_t offset;
{
ssize_t result;
if (SINGLE_THREAD_P)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
LIBC_CANCEL_RESET (oldtype);
return result;
}
weak_alias (__libc_pread64, __pread64)
weak_alias (__libc_pread64, pread64)

View File

@ -0,0 +1,31 @@
/* Low-level statistical profiling support function. Linux/ARM version.
Copyright (C) 1996-2014 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 <signal.h>
#include <sigcontextinfo.h>
void
profil_counter (int signo, const SIGCONTEXT scp)
{
profil_count ((void *) GET_PC (scp));
/* This is a hack to prevent the compiler from implementing the
above function call as a sibcall. The sibcall would overwrite
the signal context. */
asm volatile ("");
}

View File

@ -0,0 +1,58 @@
/* Copyright (C) 1997-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
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 <errno.h>
#include <endian.h>
#include <unistd.h>
#include <sysdep-cancel.h>
#include <sys/syscall.h>
ssize_t
__libc_pwrite (fd, buf, count, offset)
int fd;
const void *buf;
size_t count;
off_t offset;
{
ssize_t result;
if (SINGLE_THREAD_P)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset));
LIBC_CANCEL_RESET (oldtype);
return result;
}
strong_alias (__libc_pwrite, __pwrite)
weak_alias (__libc_pwrite, pwrite)

View File

@ -0,0 +1,61 @@
/* Copyright (C) 1997-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
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 <errno.h>
#include <endian.h>
#include <unistd.h>
#include <sysdep-cancel.h>
#include <sys/syscall.h>
ssize_t
__libc_pwrite64 (fd, buf, count, offset)
int fd;
const void *buf;
size_t count;
off64_t offset;
{
ssize_t result;
if (SINGLE_THREAD_P)
{
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
return result;
}
int oldtype = LIBC_CANCEL_ASYNC ();
/* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */
result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
LIBC_CANCEL_RESET (oldtype);
return result;
}
weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_weak (__pwrite64)
weak_alias (__libc_pwrite64, pwrite64)

View File

@ -0,0 +1,37 @@
/* Provide kernel hint to read ahead.
Copyright (C) 2002-2014 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 <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <endian.h>
#include <sysdep.h>
#include <sys/syscall.h>
ssize_t
__readahead (int fd, off64_t offset, size_t count)
{
return INLINE_SYSCALL (readahead, 5, fd, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)),
count);
}
weak_alias (__readahead, readahead)

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/readdir64.c>

View File

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/i386/readdir64_r.c>

View File

@ -0,0 +1,79 @@
/* Copyright (C) 1999-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
Jakub Jelinek <jakub@redhat.com>, 1999.
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/>. */
int process_elf32_file (const char *file_name, const char *lib, int *flag,
unsigned int *osversion, char **soname,
void *file_contents, size_t file_length);
int process_elf64_file (const char *file_name, const char *lib, int *flag,
unsigned int *osversion, char **soname,
void *file_contents, size_t file_length);
/* Returns 0 if everything is ok, != 0 in case of error. */
int
process_elf_file (const char *file_name, const char *lib, int *flag,
unsigned int *osversion, char **soname, void *file_contents,
size_t file_length)
{
ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
int ret;
if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
{
Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header;
ret = process_elf32_file (file_name, lib, flag, osversion, soname,
file_contents, file_length);
if (!ret && EF_ARM_EABI_VERSION (elf32_header->e_flags) == EF_ARM_EABI_VER5)
{
if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD)
*flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;
else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT)
*flag = FLAG_ARM_LIBSF|FLAG_ELF_LIBC6;
else
/* We must assume the unmarked objects are compatible
with all ABI variants. Such objects may have been
generated in a transitional period when the ABI
tags were not added to all objects. */
*flag = FLAG_ELF_LIBC6;
}
}
else
{
ret = process_elf64_file (file_name, lib, flag, osversion, soname,
file_contents, file_length);
/* AArch64 libraries are always libc.so.6+. */
if (!ret)
*flag = FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
}
return ret;
}
#undef __ELF_NATIVE_CLASS
#undef process_elf_file
#define process_elf_file process_elf32_file
#define __ELF_NATIVE_CLASS 32
#include "elf/readelflib.c"
#undef __ELF_NATIVE_CLASS
#undef process_elf_file
#define process_elf_file process_elf64_file
#define __ELF_NATIVE_CLASS 64
#include "elf/readelflib.c"

Some files were not shown because too many files have changed in this diff Show More