]> git.ipfire.org Git - thirdparty/glibc.git/blob - ports/sysdeps/unix/sysv/linux/ia64/dl-static.c
Update copyright notices with scripts/update-copyrights
[thirdparty/glibc.git] / ports / sysdeps / unix / sysv / linux / ia64 / dl-static.c
1 /* Variable initialization. IA-64 version.
2 Copyright (C) 2001-2014 Free Software Foundation, Inc.
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
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
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
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
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 }
59 }
60
61 #endif