Add arm-nacl port.
[glibc.git] / sysdeps / arm / nacl / dl-machine.h
blob81f3755b3bea0be618ba1de57b675e755304efba
1 /* Machine-dependent ELF dynamic relocation inline functions. ARM/NaCl version.
2 Copyright (C) 2015 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef dl_machine_h
21 /* This is only needed for handling TEXTRELs and NaCl will never
22 support TEXTRELs at all. */
23 #define CLEAR_CACHE(start, end) __builtin_trap ()
25 #endif
27 /* The rest is just machine-specific.
28 This #include is outside the #ifndef because the parts of
29 dl-machine.h used only by dynamic-link.h are outside the guard. */
30 #include <sysdeps/arm/dl-machine.h>
32 #ifdef dl_machine_h
34 /* Initial entry point code for the dynamic linker.
35 The C function `_dl_start' is the real entry point;
36 its return value is the user program's entry point. */
37 #undef RTLD_START
38 #define RTLD_START asm ("\
39 .text\n\
40 .globl _start\n\
41 .type _start, %function\n\
42 .p2align 4\n\
43 _start:\n\
44 @ r0 has the pointer to the info block (see nacl_startup.h)\n\
45 mov r1, sp @ Save stack base for __libc_stack_end.\n\
46 push {r0-r3} @ Push those, maintaining alignment to 16.\n\
47 mov r0, sp @ Pointer to {info, sp} is argument.\n\
48 sfi_bl _dl_start\n\
49 pop {r1-r4} @ Restore stack, getting info block into r1.\n\
50 mov lr, #0 @ Return address for noreturn call.\n\
51 b _dl_start_user");
53 #endif