Updated to fedora-glibc-20060109T2152
[glibc/history.git] / sysdeps / unix / sysv / linux / powerpc / dl-sysdep.c
blob7c02c68985dcf715d778d5b5e7275d9986128011
1 /* Operating system support for run-time dynamic linker. Linux/PPC version.
2 Copyright (C) 1997, 1998, 2001, 2003, 2006 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, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
20 #include <config.h>
21 #include <kernel-features.h>
22 #include <ldsodefs.h>
24 extern int __cache_line_size;
25 weak_extern (__cache_line_size)
27 /* Scan the Aux Vector for the "Data Cache Block Size" entry. If found
28 verify that the static extern __cache_line_size is defined by checking
29 for not NULL. If it is defined then assign the cache block size
30 value to __cache_line_size. */
31 #define DL_PLATFORM_AUXV \
32 case AT_DCACHEBSIZE: \
33 { \
34 int *cls = & __cache_line_size; \
35 if (cls != NULL) \
36 *cls = av->a_un.a_val; \
37 } \
38 break;
40 #ifndef __ASSUME_STD_AUXV
42 /* The PowerPC's auxiliary argument block gets aligned to a 16-byte
43 boundary. This is history and impossible to change compatibly. */
45 #define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
46 do { \
47 char **_tmp; \
48 size_t _test; \
49 (argc) = *(long int *) cookie; \
50 (argv) = (char **) cookie + 1; \
51 (envp) = (argv) + (argc) + 1; \
52 for (_tmp = (envp); *_tmp; ++_tmp) \
53 continue; \
54 /* The following '++' is important! */ \
55 ++_tmp; \
57 _test = (size_t)_tmp; \
58 _test = (_test + 0xf) & ~0xf; \
59 /* Under some circumstances, MkLinux (up to at least DR3a5) \
60 omits the padding. To work around this, we make a \
61 basic sanity check of the argument vector. Of \
62 course, this means that in future, the argument \
63 vector will have to be laid out to allow for this \
64 test :-(. */ \
65 if (((ElfW(auxv_t) *)_test)->a_type <= 0x10) \
66 _tmp = (char **)_test; \
67 (auxp) = (ElfW(auxv_t) *) _tmp; \
68 } while (0)
69 #endif
71 #include <sysdeps/unix/sysv/linux/dl-sysdep.c>