]>
Commit | Line | Data |
---|---|---|
d5efd131 | 1 | /* Variable initialization. IA-64 version. |
b168057a | 2 | Copyright (C) 2001-2015 Free Software Foundation, Inc. |
d5efd131 MF |
3 | This file is part of the GNU C Library. |
4 | ||
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. | |
9 | ||
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. | |
14 | ||
15 | You should have received a copy of the GNU Lesser General Public | |
75efb018 MF |
16 | License along with the GNU C Library; if not, see |
17 | <http://www.gnu.org/licenses/>. */ | |
d5efd131 MF |
18 | |
19 | #include <ldsodefs.h> | |
20 | ||
21 | #ifdef SHARED | |
22 | ||
23 | void | |
24 | _dl_var_init (void *array[]) | |
25 | { | |
26 | /* It has to match "variables" below. */ | |
27 | enum | |
28 | { | |
29 | DL_PAGESIZE = 0, | |
30 | DL_CLKTCK | |
31 | }; | |
32 | ||
33 | GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]); | |
34 | GLRO(dl_clktck) = *((int *) array[DL_CLKTCK]); | |
35 | } | |
36 | ||
37 | #else | |
d5efd131 MF |
38 | |
39 | static void *variables[] = | |
40 | { | |
41 | &GLRO(dl_pagesize), | |
42 | &GLRO(dl_clktck) | |
43 | }; | |
44 | ||
45 | void | |
46 | _dl_static_init (struct link_map *map) | |
47 | { | |
48 | const ElfW(Sym) *ref = NULL; | |
49 | lookup_t loadbase; | |
50 | void (*f) (void *[]); | |
51 | ||
d5efd131 MF |
52 | loadbase = _dl_lookup_symbol_x ("_dl_var_init", map, &ref, |
53 | map->l_local_scope, NULL, 0, 1, NULL); | |
54 | if (ref != NULL) | |
55 | { | |
56 | f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref); | |
57 | f (variables); | |
58 | } | |
d5efd131 MF |
59 | } |
60 | ||
61 | #endif |