1 /* Support for reading /etc/ld.so.cache files written by Linux ldconfig.
2 Copyright (C) 2004 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
23 unsigned int fl1
, fl2
;
25 /* See if we can use cpuid. */
26 __asm__ ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;"
27 "pushl %0; popfl; pushfl; popl %0; popfl"
28 : "=&r" (fl1
), "=&r" (fl2
)
30 if (((fl1
^ fl2
) & 0x00200000) == 0)
33 /* Host supports cpuid. See if cpuid gives capabilities, try
34 CPUID(0). Preserve %ebx and %ecx; cpuid insn clobbers these, we
35 don't need their CPUID values here, and %ebx may be the PIC
37 __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx"
38 : "=a" (fl1
) : "0" (0) : "edx", "cc");
42 /* Invoke CPUID(1), return %edx; caller can examine bits to
43 determine what's supported. */
44 __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx"
45 : "=d" (fl2
), "=a" (fl1
) : "1" (1) : "cc");
46 return (fl2
& (1 << 30)) != 0;
49 #define arch_startup(argc, argv) \
51 /* On IA-64, try to execute 64-bit ldconfig if possible. \
52 This is because the badly designed /emul/ia32-linux hack \
53 will cause 32-bit ldconfig to do all sorts of weird things. */ \
55 execv ("/emul/ia32-linux/../../sbin/ldconfig", \
56 (char *const *) argv); \
59 #include_next <dl-cache.h>