forked from bminor/glibc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
127 changed files
with
5,120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
arm/nptl | ||
init_array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.