Permalink
Please sign in to comment.
Showing
with
5,120 additions
and 0 deletions.
- +7 −0 ChangeLog
- +2 −0 abi-tags
- +2 −0 sysdeps/arm/nacl/Implies
- +33 −0 sysdeps/arm/nacl/Makefile
- +47 −0 sysdeps/arm/nacl/____longjmp_chk.S
- +44 −0 sysdeps/arm/nacl/aeabi_read_tp.S
- +43 −0 sysdeps/arm/nacl/arm-features.h
- +53 −0 sysdeps/arm/nacl/dl-machine.h
- +278 −0 sysdeps/arm/nacl/dl-trampoline.S
- +38 −0 sysdeps/arm/nacl/include/bits/setjmp.h
- +4 −0 sysdeps/arm/nacl/shlib-versions
- +1 −0 sysdeps/arm/nacl/start.c
- +69 −0 sysdeps/arm/nacl/sysdep.h
- +2 −0 sysdeps/arm/nacl/tls.h
- +3 −0 sysdeps/nacl/Implies
- +135 −0 sysdeps/nacl/Makefile
- +3 −0 sysdeps/nacl/Subdirs
- +21 −0 sysdeps/nacl/Versions
- +34 −0 sysdeps/nacl/_exit.c
- +28 −0 sysdeps/nacl/access.c
- +1 −0 sysdeps/nacl/backtrace.c
- +52 −0 sysdeps/nacl/bits/dirent.h
- +149 −0 sysdeps/nacl/bits/fcntl.h
- +64 −0 sysdeps/nacl/bits/local_lim.h
- +24 −0 sysdeps/nacl/bits/mman.h
- +23 −0 sysdeps/nacl/bits/param.h
- +210 −0 sysdeps/nacl/bits/posix_opt.h
- +147 −0 sysdeps/nacl/bits/stat.h
- +71 −0 sysdeps/nacl/bits/typesizes.h
- +93 −0 sysdeps/nacl/brk.c
- +28 −0 sysdeps/nacl/chdir.c
- +23 −0 sysdeps/nacl/check_fds.c
- +28 −0 sysdeps/nacl/chmod.c
- +29 −0 sysdeps/nacl/clock.c
- +28 −0 sysdeps/nacl/clock_getres.c
- +29 −0 sysdeps/nacl/clock_gettime.c
- +31 −0 sysdeps/nacl/close.c
- +18 −0 sysdeps/nacl/configure
- +18 −0 sysdeps/nacl/configure.ac
- +46 −0 sysdeps/nacl/createthread.c
- +238 −0 sysdeps/nacl/dl-map-segments.h
- +34 −0 sysdeps/nacl/dl-osinfo.h
- +89 −0 sysdeps/nacl/dl-sysdep.c
- +30 −0 sysdeps/nacl/dl-sysdep.h
- +65 −0 sysdeps/nacl/dl-unmap-segments.h
- +45 −0 sysdeps/nacl/dl-writev.h
- +30 −0 sysdeps/nacl/dup.c
- +31 −0 sysdeps/nacl/dup2.c
- +6 −0 sysdeps/nacl/entry.h
- +87 −0 sysdeps/nacl/errnos.awk
- +27 −0 sysdeps/nacl/euidaccess.c
- +35 −0 sysdeps/nacl/exit-thread.h
- +28 −0 sysdeps/nacl/fchdir.c
- +28 −0 sysdeps/nacl/fchmod.c
- +28 −0 sysdeps/nacl/fdatasync.c
- +3 −0 sysdeps/nacl/fork.c
- +27 −0 sysdeps/nacl/fsync.c
- +32 −0 sysdeps/nacl/ftruncate.c
- +1 −0 sysdeps/nacl/ftruncate64.c
- +45 −0 sysdeps/nacl/fxstat.c
- +1 −0 sysdeps/nacl/fxstat64.c
- +56 −0 sysdeps/nacl/getcwd.c
- +29 −0 sysdeps/nacl/getdents.c
- +1 −0 sysdeps/nacl/getdents64.c
- +28 −0 sysdeps/nacl/getdtsz.c
- +1 −0 sysdeps/nacl/getpagesize.c
- +32 −0 sysdeps/nacl/getpid.c
- +65 −0 sysdeps/nacl/getsysstats.c
- +40 −0 sysdeps/nacl/gettimeofday.c
- +26 −0 sysdeps/nacl/glob.c
- +1 −0 sysdeps/nacl/glob64.c
- +2 −0 sysdeps/nacl/ifaddrs.c
- +27 −0 sysdeps/nacl/init-first.c
- +26 −0 sysdeps/nacl/iofdopen.c
- +12 −0 sysdeps/nacl/irt.sed
- +38 −0 sysdeps/nacl/isatty.c
- +28 −0 sysdeps/nacl/kernel-features.h
- +35 −0 sysdeps/nacl/ldsodefs.h
- +4 −0 sysdeps/nacl/libc-start.c
- +28 −0 sysdeps/nacl/link.c
- +87 −0 sysdeps/nacl/lowlevellock-futex.h
- +43 −0 sysdeps/nacl/lseek.c
- +1 −0 sysdeps/nacl/lseek64.c
- +46 −0 sysdeps/nacl/lxstat.c
- +1 −0 sysdeps/nacl/lxstat64.c
- +28 −0 sysdeps/nacl/mkdir.c
- +49 −0 sysdeps/nacl/mmap.c
- +1 −0 sysdeps/nacl/mmap64.c
- +33 −0 sysdeps/nacl/mprotect.c
- +32 −0 sysdeps/nacl/munmap.c
- +69 −0 sysdeps/nacl/nacl-after-link.sh
- +47 −0 sysdeps/nacl/nacl-interface-list.h
- +43 −0 sysdeps/nacl/nacl-interface-table.c
- +123 −0 sysdeps/nacl/nacl-interfaces.c
- +108 −0 sysdeps/nacl/nacl-interfaces.h
- +25 −0 sysdeps/nacl/nacl-interfaces.mk.in
- +280 −0 sysdeps/nacl/nacl-test-wrapper.sh
- +49 −0 sysdeps/nacl/nacl_interface_query.c
- +33 −0 sysdeps/nacl/nanosleep.c
- +52 −0 sysdeps/nacl/open.c
- +1 −0 sysdeps/nacl/open64.c
- +7 −0 sysdeps/nacl/preconfigure
- +2 −0 sysdeps/nacl/profil.c
- +32 −0 sysdeps/nacl/read.c
- +11 −0 sysdeps/nacl/readdir.c
- +1 −0 sysdeps/nacl/readdir64.c
- +1 −0 sysdeps/nacl/readdir64_r.c
- +8 −0 sysdeps/nacl/readdir_r.c
- +32 −0 sysdeps/nacl/readlink.c
- +27 −0 sysdeps/nacl/rename.c
- +28 −0 sysdeps/nacl/rmdir.c
- +31 −0 sysdeps/nacl/sched_yield.c
- +9 −0 sysdeps/nacl/shlib-versions
- +11 −0 sysdeps/nacl/sigaction.c
- +2 −0 sysdeps/nacl/sprofil.c
- +73 −0 sysdeps/nacl/start.c
- +28 −0 sysdeps/nacl/symlink.c
- +41 −0 sysdeps/nacl/tls.h
- +32 −0 sysdeps/nacl/truncate.c
- +1 −0 sysdeps/nacl/truncate64.c
- +28 −0 sysdeps/nacl/unlink.c
- +29 −0 sysdeps/nacl/utimes.c
- +33 −0 sysdeps/nacl/write.c
- +45 −0 sysdeps/nacl/xstat.c
- +1 −0 sysdeps/nacl/xstat64.c
- +76 −0 sysdeps/nacl/xstatconv.c
- +32 −0 sysdeps/nacl/xstatconv.h
@@ -0,0 +1,2 @@ | |||
arm/nptl | |||
init_array |
@@ -0,0 +1,33 @@ | |||
# Makefile fragment for ARM/NaCl configurations. | |||
|
|||
# Copyright (C) 2015 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/>. | |||
|
|||
# sysdeps/nacl/Makefile needs this set to the architecture suffix used in | |||
# the NaCl SDK. | |||
nacl-sdk-arch = arm | |||
|
|||
# We don't really support TLSDESC, even though the compiler thinks it does. | |||
have-arm-tls-desc = no | |||
|
|||
ifeq ($(subdir),csu) | |||
sysdep_routines += aeabi_read_tp | |||
endif | |||
|
|||
ifeq ($(subdir),elf) | |||
sysdep-rtld-routines += aeabi_read_tp | |||
endif |
@@ -0,0 +1,47 @@ | |||
/* longjmp that validates stack addresses. ARM/NaCl version. | |||
Copyright (C) 2015 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 | |||
|
|||
/* We don't have sigaltstack and so any longjmp must be to an outer frame. */ | |||
.macro check_sp reg | |||
cmp sp, \reg | |||
bls .Lok | |||
#ifdef PIC | |||
movw r0, #:lower16:longjmp_msg-(.LPIC0+8) | |||
movt r0, #:upper16:longjmp_msg-(.LPIC0+8) | |||
.LPIC0: add r0, r0, pc | |||
#else | |||
movw r0, #:lower16:longjmp_msg | |||
movt r0, #:upper16:longjmp_msg | |||
#endif | |||
b HIDDEN_JUMPTARGET(__fortify_fail) | |||
.Lok: | |||
.endm | |||
|
|||
#define CHECK_SP(reg) check_sp reg | |||
#define __longjmp ____longjmp_chk | |||
#include <__longjmp.S> |
@@ -0,0 +1,44 @@ | |||
/* ARM EABI helper function for reading the thread pointer. NaCl version. | |||
Copyright (C) 2015 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. */ | |||
|
|||
.hidden __aeabi_read_tp | |||
ENTRY (__aeabi_read_tp) | |||
ldr r0, [r9] | |||
sfi_bx lr | |||
END (__aeabi_read_tp) |
@@ -0,0 +1,43 @@ | |||
/* Macros to test for CPU features on ARM. NaCl version. | |||
Copyright (C) 2015 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 _NACL_ARM_FEATURES_H | |||
#define _NACL_ARM_FEATURES_H 1 | |||
|
|||
#ifdef __SOFTFP__ | |||
# error NaCl should always have VFP enabled | |||
#endif | |||
|
|||
/* NaCl does not support iWMMXt at all. */ | |||
#define ARM_ASSUME_NO_IWMMXT 1 | |||
|
|||
/* NaCl does not allow instructions to target the pc register. */ | |||
#define ARM_ALWAYS_BX 1 | |||
|
|||
/* Computed branch targets must be bundle-aligned, which is to 16 bytes. */ | |||
#define ARM_BX_ALIGN_LOG2 4 | |||
|
|||
/* Two-register addressing modes are never allowed. */ | |||
#define ARM_NO_INDEX_REGISTER 1 | |||
|
|||
/* Only ARM mode code is allowed, never Thumb mode. */ | |||
#define NO_THUMB | |||
|
|||
#include_next <arm-features.h> | |||
|
|||
#endif /* arm-features.h */ |
@@ -0,0 +1,53 @@ | |||
/* Machine-dependent ELF dynamic relocation inline functions. ARM/NaCl version. | |||
Copyright (C) 2015 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 is only needed for handling TEXTRELs and NaCl will never | |||
support TEXTRELs at all. */ | |||
#define CLEAR_CACHE(start, end) __builtin_trap () | |||
|
|||
#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> | |||
|
|||
#ifdef dl_machine_h | |||
|
|||
/* Initial entry point code for the dynamic linker. | |||
The C function `_dl_start' is the real entry point; | |||
its return value is the user program's entry point. */ | |||
#undef RTLD_START | |||
#define RTLD_START asm ("\ | |||
.text\n\ | |||
.globl _start\n\ | |||
.type _start, %function\n\ | |||
.p2align 4\n\ | |||
_start:\n\ | |||
@ r0 has the pointer to the info block (see nacl_startup.h)\n\ | |||
mov r1, sp @ Save stack base for __libc_stack_end.\n\ | |||
push {r0-r3} @ Push those, maintaining alignment to 16.\n\ | |||
mov r0, sp @ Pointer to {info, sp} is argument.\n\ | |||
sfi_bl _dl_start\n\ | |||
pop {r1-r4} @ Restore stack, getting info block into r1.\n\ | |||
mov lr, #0 @ Return address for noreturn call.\n\ | |||
b _dl_start_user"); | |||
|
|||
#endif |

Oops, something went wrong.
0 comments on commit
d1e44df