1 2010-08-18 Mike Frysinger <vapier@gentoo.org>
3 * sysdeps/unix/sysv/linux/ia64/Makefile: Move dl-static addition to
4 sysdep vars for subdir==elf to ...
5 * sysdeps/unix/sysv/linux/Makefile: ... here.
6 * sysdeps/unix/sysv/linux/ia64/dl-static.c: Move file to ...
7 * sysdeps/unix/sysv/linux/dl-static.c: ... here.
8 * sysdeps/unix/sysv/linux/ia64/ldsodefs.h: Delete, and move the
9 DL_STATIC_INIT defines to ...
10 * sysdeps/unix/sysv/linux/ldsodefs.h: ... here.
11 * sysdeps/unix/sysv/linux/ia64/getpagesize.c: Delete.
13 diff --git a/sysdeps/unix/sysv/linux/ia64/Makefile b/sysdeps/unix/sysv/linux/ia64/Makefile
14 index d9a35a7..3bb1ce0 100644
15 --- a/sysdeps/unix/sysv/linux/ia64/Makefile
16 +++ b/sysdeps/unix/sysv/linux/ia64/Makefile
17 @@ -12,12 +12,6 @@ sysdep_headers += sys/io.h
18 sysdep_routines += ioperm clone2
22 -sysdep-dl-routines += dl-static
23 -sysdep_routines += $(sysdep-dl-routines)
24 -sysdep-rtld-routines += $(sysdep-dl-routines)
28 librt-routines += rt-sysdep
30 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
31 index 4302bd3..37c56a3 100644
32 --- a/sysdeps/unix/sysv/linux/Makefile
33 +++ b/sysdeps/unix/sysv/linux/Makefile
34 @@ -147,7 +147,9 @@ sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
38 -sysdep-rtld-routines += dl-brk dl-sbrk
39 +sysdep-dl-routines += dl-static
40 +sysdep_routines += dl-static
41 +sysdep-rtld-routines += dl-brk dl-sbrk dl-static
43 CPPFLAGS-lddlibc4 += -DNOT_IN_libc
45 diff --git a/sysdeps/unix/sysv/linux/ia64/dl-static.c b/sysdeps/unix/sysv/linux/ia64/dl-static.c
46 deleted file mode 100644
47 index 4efc077..0000000
48 --- a/sysdeps/unix/sysv/linux/ia64/dl-static.c
51 -/* Variable initialization. IA-64 version.
52 - Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
53 - This file is part of the GNU C Library.
55 - The GNU C Library is free software; you can redistribute it and/or
56 - modify it under the terms of the GNU Lesser General Public
57 - License as published by the Free Software Foundation; either
58 - version 2.1 of the License, or (at your option) any later version.
60 - The GNU C Library is distributed in the hope that it will be useful,
61 - but WITHOUT ANY WARRANTY; without even the implied warranty of
62 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
63 - Lesser General Public License for more details.
65 - You should have received a copy of the GNU Lesser General Public
66 - License along with the GNU C Library; if not, write to the Free
67 - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
70 -#include <ldsodefs.h>
75 -_dl_var_init (void *array[])
77 - /* It has to match "variables" below. */
84 - GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
85 - GLRO(dl_clktck) = *((int *) array[DL_CLKTCK]);
89 -#include <bits/libc-lock.h>
91 -__libc_lock_define_initialized_recursive (static, _dl_static_lock)
93 -static void *variables[] =
100 -_dl_static_init (struct link_map *map)
102 - const ElfW(Sym) *ref = NULL;
104 - void (*f) (void *[]);
106 - __libc_lock_lock_recursive (_dl_static_lock);
108 - loadbase = _dl_lookup_symbol_x ("_dl_var_init", map, &ref,
109 - map->l_local_scope, NULL, 0, 1, NULL);
112 - f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
116 - __libc_lock_unlock_recursive (_dl_static_lock);
120 diff --git a/sysdeps/unix/sysv/linux/dl-static.c b/sysdeps/unix/sysv/linux/dl-static.c
122 index 0000000..fa70811
124 +++ b/sysdeps/unix/sysv/linux/dl-static.c
126 +/* Variable initialization.
127 + Copyright (C) 2001, 2002, 2003, 2004, 2010 Free Software Foundation, Inc.
128 + This file is part of the GNU C Library.
130 + The GNU C Library is free software; you can redistribute it and/or
131 + modify it under the terms of the GNU Lesser General Public
132 + License as published by the Free Software Foundation; either
133 + version 2.1 of the License, or (at your option) any later version.
135 + The GNU C Library is distributed in the hope that it will be useful,
136 + but WITHOUT ANY WARRANTY; without even the implied warranty of
137 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
138 + Lesser General Public License for more details.
140 + You should have received a copy of the GNU Lesser General Public
141 + License along with the GNU C Library; if not, write to the Free
142 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
145 +#include <ldsodefs.h>
150 +_dl_var_init (void *array[])
152 + /* It has to match "variables" below. */
159 + GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
160 + GLRO(dl_clktck) = *((int *) array[DL_CLKTCK]);
164 +#include <bits/libc-lock.h>
166 +__libc_lock_define_initialized_recursive (static, _dl_static_lock)
168 +static void *variables[] =
170 + &GLRO(dl_pagesize),
175 +_dl_static_init (struct link_map *map)
177 + const ElfW(Sym) *ref = NULL;
179 + void (*f) (void *[]);
181 + __libc_lock_lock_recursive (_dl_static_lock);
183 + loadbase = _dl_lookup_symbol_x ("_dl_var_init", map, &ref,
184 + map->l_local_scope, NULL, 0, 1, NULL);
187 + f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
191 + __libc_lock_unlock_recursive (_dl_static_lock);
195 diff --git a/sysdeps/unix/sysv/linux/ia64/ldsodefs.h b/sysdeps/unix/sysv/linux/ia64/ldsodefs.h
196 deleted file mode 100644
197 index 31af624..0000000
198 --- a/sysdeps/unix/sysv/linux/ia64/ldsodefs.h
201 -/* Run-time dynamic linker data structures for loaded ELF shared objects. IA64.
202 - Copyright (C) 2001 Free Software Foundation, Inc.
203 - This file is part of the GNU C Library.
205 - The GNU C Library is free software; you can redistribute it and/or
206 - modify it under the terms of the GNU Lesser General Public
207 - License as published by the Free Software Foundation; either
208 - version 2.1 of the License, or (at your option) any later version.
210 - The GNU C Library is distributed in the hope that it will be useful,
211 - but WITHOUT ANY WARRANTY; without even the implied warranty of
212 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
213 - Lesser General Public License for more details.
215 - You should have received a copy of the GNU Lesser General Public
216 - License along with the GNU C Library; if not, write to the Free
217 - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
222 -/* Get the real definitions. */
223 -#include_next <ldsodefs.h>
225 -/* Now define our stuff. */
227 -/* We need special support to initialize DSO loaded for statically linked
229 -extern void _dl_static_init (struct link_map *map);
230 -#undef DL_STATIC_INIT
231 -#define DL_STATIC_INIT(map) _dl_static_init (map)
233 -#endif /* ldsodefs.h */
234 diff --git a/sysdeps/unix/sysv/linux/ldsodefs.h b/sysdeps/unix/sysv/linux/ldsodefs.h
235 index 5d5b1b4..ecb5d4f 100644
236 --- a/sysdeps/unix/sysv/linux/ldsodefs.h
237 +++ b/sysdeps/unix/sysv/linux/ldsodefs.h
238 @@ -36,6 +36,12 @@ extern void _dl_aux_init (ElfW(auxv_t) *av) internal_function;
239 /* Initialization which is normally done by the dynamic linker. */
240 extern void _dl_non_dynamic_init (void) internal_function;
242 +/* We need special support to initialize DSO loaded for statically linked
244 +extern void _dl_static_init (struct link_map *map);
245 +#undef DL_STATIC_INIT
246 +#define DL_STATIC_INIT(map) _dl_static_init (map)
248 /* We can assume that the kernel always provides the AT_UID, AT_EUID,
249 AT_GID, and AT_EGID values in the auxiliary vector from 2.4.0 or so on. */
251 diff --git a/sysdeps/unix/sysv/linux/ia64/getpagesize.c b/sysdeps/unix/sysv/linux/ia64/getpagesize.c
252 deleted file mode 100644
253 index 1155dfd..0000000
254 --- a/sysdeps/unix/sysv/linux/ia64/getpagesize.c
257 -/* Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
258 - This file is part of the GNU C Library.
260 - The GNU C Library is free software; you can redistribute it and/or
261 - modify it under the terms of the GNU Lesser General Public
262 - License as published by the Free Software Foundation; either
263 - version 2.1 of the License, or (at your option) any later version.
265 - The GNU C Library is distributed in the hope that it will be useful,
266 - but WITHOUT ANY WARRANTY; without even the implied warranty of
267 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
268 - Lesser General Public License for more details.
270 - You should have received a copy of the GNU Lesser General Public
271 - License along with the GNU C Library; if not, write to the Free
272 - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
277 -#include <sys/param.h>
279 -#include <ldsodefs.h>
281 -#include <sys/syscall.h>
283 -/* Return the system page size. The return value will depend on how
284 - the kernel is configured. A program must use this call to
285 - determine the page size to ensure proper alignment for calls such
286 - as mmap and friends. --davidm 99/11/30 */
291 - assert (GLRO(dl_pagesize) != 0);
292 - return GLRO(dl_pagesize);
294 -libc_hidden_def (__getpagesize)
295 -weak_alias (__getpagesize, getpagesize)