Update copyright notices with scripts/update-copyrights
[glibc.git] / ports / sysdeps / unix / sysv / linux / ia64 / dl-static.c
blob51fa79633f52f6bbb6d4cc6f94a190dc711b8792
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.
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 #include <ldsodefs.h>
21 #ifdef SHARED
23 void
24 _dl_var_init (void *array[])
26 /* It has to match "variables" below. */
27 enum
29 DL_PAGESIZE = 0,
30 DL_CLKTCK
33 GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
34 GLRO(dl_clktck) = *((int *) array[DL_CLKTCK]);
37 #else
39 static void *variables[] =
41 &GLRO(dl_pagesize),
42 &GLRO(dl_clktck)
45 void
46 _dl_static_init (struct link_map *map)
48 const ElfW(Sym) *ref = NULL;
49 lookup_t loadbase;
50 void (*f) (void *[]);
52 loadbase = _dl_lookup_symbol_x ("_dl_var_init", map, &ref,
53 map->l_local_scope, NULL, 0, 1, NULL);
54 if (ref != NULL)
56 f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
57 f (variables);
61 #endif