Replace FSF snail mail address with URLs.
[glibc.git] / sysdeps / unix / sysv / linux / powerpc / dl-sysdep.c
blob00595f9ffe3627c57ec27eaf84111885e4d16c33
1 /* Operating system support for run-time dynamic linker. Linux/PPC version.
2 Copyright (C) 1997, 1998, 2001, 2003, 2006, 2007
3 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
20 #include <config.h>
21 #include <kernel-features.h>
22 #include <ldsodefs.h>
24 int __cache_line_size attribute_hidden;
26 /* Scan the Aux Vector for the "Data Cache Block Size" entry. If found
27 verify that the static extern __cache_line_size is defined by checking
28 for not NULL. If it is defined then assign the cache block size
29 value to __cache_line_size. */
30 #define DL_PLATFORM_AUXV \
31 case AT_DCACHEBSIZE: \
32 __cache_line_size = av->a_un.a_val; \
33 break;
35 #ifndef __ASSUME_STD_AUXV
37 /* The PowerPC's auxiliary argument block gets aligned to a 16-byte
38 boundary. This is history and impossible to change compatibly. */
40 #define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
41 do { \
42 char **_tmp; \
43 size_t _test; \
44 (argc) = *(long int *) cookie; \
45 (argv) = (char **) cookie + 1; \
46 (envp) = (argv) + (argc) + 1; \
47 for (_tmp = (envp); *_tmp; ++_tmp) \
48 continue; \
49 /* The following '++' is important! */ \
50 ++_tmp; \
52 _test = (size_t)_tmp; \
53 _test = (_test + 0xf) & ~0xf; \
54 /* Under some circumstances, MkLinux (up to at least DR3a5) \
55 omits the padding. To work around this, we make a \
56 basic sanity check of the argument vector. Of \
57 course, this means that in future, the argument \
58 vector will have to be laid out to allow for this \
59 test :-(. */ \
60 if (((ElfW(auxv_t) *)_test)->a_type <= 0x10) \
61 _tmp = (char **)_test; \
62 (auxp) = (ElfW(auxv_t) *) _tmp; \
63 } while (0)
64 #endif
66 #include <sysdeps/unix/sysv/linux/dl-sysdep.c>