[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r22934 - in /fsf/trunk/libc: ./ csu/ elf/ soft-fp/ sysdeps/generic/ sysdeps/x86_64/
- To: commits@xxxxxxxxxx
- Subject: [Commits] r22934 - in /fsf/trunk/libc: ./ csu/ elf/ soft-fp/ sysdeps/generic/ sysdeps/x86_64/
- From: eglibc@xxxxxxxxxx
- Date: Fri, 26 Apr 2013 00:01:51 -0000
Author: eglibc
Date: Fri Apr 26 00:01:50 2013
New Revision: 22934
Log:
Import glibc-mainline for 2013-04-26
Added:
fsf/trunk/libc/sysdeps/x86_64/tst-audit3.c
fsf/trunk/libc/sysdeps/x86_64/tst-audit4.c
fsf/trunk/libc/sysdeps/x86_64/tst-audit5.c
fsf/trunk/libc/sysdeps/x86_64/tst-audit6.c
fsf/trunk/libc/sysdeps/x86_64/tst-audit7.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod3a.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod3b.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod4a.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod4b.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod5a.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod5b.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6a.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6b.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6c.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod7a.c
fsf/trunk/libc/sysdeps/x86_64/tst-auditmod7b.c
Removed:
fsf/trunk/libc/elf/tst-audit3.c
fsf/trunk/libc/elf/tst-audit4.c
fsf/trunk/libc/elf/tst-audit5.c
fsf/trunk/libc/elf/tst-audit6.c
fsf/trunk/libc/elf/tst-audit7.c
fsf/trunk/libc/elf/tst-auditmod3a.c
fsf/trunk/libc/elf/tst-auditmod3b.c
fsf/trunk/libc/elf/tst-auditmod4a.c
fsf/trunk/libc/elf/tst-auditmod4b.c
fsf/trunk/libc/elf/tst-auditmod5a.c
fsf/trunk/libc/elf/tst-auditmod5b.c
fsf/trunk/libc/elf/tst-auditmod6a.c
fsf/trunk/libc/elf/tst-auditmod6b.c
fsf/trunk/libc/elf/tst-auditmod6c.c
fsf/trunk/libc/elf/tst-auditmod7a.c
fsf/trunk/libc/elf/tst-auditmod7b.c
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/NEWS
fsf/trunk/libc/csu/libc-start.c
fsf/trunk/libc/elf/Makefile
fsf/trunk/libc/soft-fp/op-common.h
fsf/trunk/libc/sysdeps/generic/inttypes.h
fsf/trunk/libc/sysdeps/generic/stdint.h
fsf/trunk/libc/sysdeps/x86_64/Makefile
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri Apr 26 00:01:50 2013
@@ -1,3 +1,115 @@
+2013-04-25 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * elf/Makefile [$(config-machine) = x86_64] (tests): Remove
+ additions to variable.
+ [$(config-machine) = x86_64] (modules-names): Likewise.
+ ($(objpfx)tst-audit3): Remove dependency.
+ ($(objpfx)tst-audit3.out): Likewise.
+ ($(objpfx)tst-audit4): Likewise.
+ ($(objpfx)tst-audit4.out): Likewise.
+ ($(objpfx)tst-audit5): Likewise.
+ ($(objpfx)tst-audit5.out): Likewise.
+ ($(objpfx)tst-audit6): Likewise.
+ ($(objpfx)tst-audit6.out): Likewise.
+ ($(objpfx)tst-audit7): Likewise.
+ ($(objpfx)tst-audit7.out): Likewise.
+ (tst-audit3-ENV): Remove variable.
+ (tst-audit4-ENV): Likewise.
+ (tst-audit5-ENV): Likewise.
+ (tst-audit6-ENV): Likewise.
+ (tst-audit7-ENV): Likewise.
+ [$(config-cflags-avx) = yes] (AVX-CFLAGS): Likewise.
+ [$(config-cflags-avx) = yes] (CFLAGS-tst-audit4.c): Remove
+ addition to variable.
+ [$(config-cflags-avx) = yes] (CFLAGS-tst-auditmod4a.c): Likewise.
+ [$(config-cflags-avx) = yes] (CFLAGS-tst-auditmod4b.c): Likewise.
+ [$(config-cflags-avx) = yes] (CFLAGS-tst-auditmod6b.c): Likewise.
+ [$(config-cflags-avx) = yes] (CFLAGS-tst-auditmod6c.c): Likewise.
+ [$(config-cflags-avx) = yes] (CFLAGS-tst-auditmod7b.c): Likewise.
+ * sysdeps/x86_64/Makefile [$(subdir) = elf] (tests): Add
+ tst-audit3, tst-audit4 and tst-audit5.
+ [$(subdir) = elf && $(config-cflags-avx) = yes] (tests): Add
+ tst-audit6 and tst-audit7.
+ [$(subdir) = elf] (modules-names): Add audit modules for those
+ tests.
+ [$(subdir) = elf] ($(objpfx)tst-audit3): New dependency.
+ [$(subdir) = elf] ($(objpfx)tst-audit3.out): Likewise.
+ [$(subdir) = elf] ($(objpfx)tst-audit4): Likewise.
+ [$(subdir) = elf] ($(objpfx)tst-audit4.out): Likewise.
+ [$(subdir) = elf] ($(objpfx)tst-audit5): Likewise.
+ [$(subdir) = elf] ($(objpfx)tst-audit5.out): Likewise.
+ [$(subdir) = elf] ($(objpfx)tst-audit6): Likewise.
+ [$(subdir) = elf] ($(objpfx)tst-audit6.out): Likewise.
+ [$(subdir) = elf] ($(objpfx)tst-audit7): Likewise.
+ [$(subdir) = elf] ($(objpfx)tst-audit7.out): Likewise.
+ [$(subdir) = elf] (tst-audit3-ENV): New variable.
+ [$(subdir) = elf] (tst-audit4-ENV): Likewise.
+ [$(subdir) = elf] (tst-audit5-ENV): Likewise.
+ [$(subdir) = elf] (tst-audit6-ENV): Likewise.
+ [$(subdir) = elf] (tst-audit7-ENV): Likewise.
+ [$(subdir) = elf && $(config-cflags-avx) = yes] (AVX-CFLAGS):
+ Likewise.
+ [$(subdir) = elf && $(config-cflags-avx) = yes]
+ (CFLAGS-tst-audit4.c): Append $(AVX-CFLAGS).
+ [$(subdir) = elf && $(config-cflags-avx) = yes]
+ (CFLAGS-tst-auditmod4a.c): Likewise.
+ [$(subdir) = elf && $(config-cflags-avx) = yes]
+ (CFLAGS-tst-auditmod4b.c): Likewise.
+ [$(subdir) = elf && $(config-cflags-avx) = yes]
+ (CFLAGS-tst-auditmod6b.c): Likewise.
+ [$(subdir) = elf && $(config-cflags-avx) = yes]
+ (CFLAGS-tst-auditmod6c.c): Likewise.
+ [$(subdir) = elf && $(config-cflags-avx) = yes]
+ (CFLAGS-tst-auditmod7b.c): Likewise.
+ * elf/tst-audit3.c: Move to ...
+ * sysdeps/x86_64/tst-audit3.c: ... here.
+ * elf/tst-audit4.c: Move to ...
+ * sysdeps/x86_64/tst-audit4.c: ... here.
+ * elf/tst-audit5.c: Move to ...
+ * sysdeps/x86_64/tst-audit5.c: ... here.
+ * elf/tst-audit6.c: Move to ...
+ * sysdeps/x86_64/tst-audit6.c: ... here.
+ * elf/tst-audit7.c: Move to ...
+ * sysdeps/x86_64/tst-audit7.c: ... here.
+ * elf/tst-auditmod3a.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod3a.c: ... here.
+ * elf/tst-auditmod3b.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod3b.c: ... here.
+ * elf/tst-auditmod4a.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod4a.c: ... here.
+ * elf/tst-auditmod4b.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod4b.c: ... here.
+ * elf/tst-auditmod5a.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod5a.c: ... here.
+ * elf/tst-auditmod5b.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod5b.c: ... here.
+ * elf/tst-auditmod6a.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod6a.c: ... here.
+ * elf/tst-auditmod6b.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod6b.c: ... here.
+ * elf/tst-auditmod6c.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod6c.c: ... here.
+ * elf/tst-auditmod7a.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod7a.c: ... here.
+ * elf/tst-auditmod7b.c: Move to ...
+ * sysdeps/x86_64/tst-auditmod7b.c: ... here.
+
+2013-04-25 Paul Pluzhnikov <ppluzhnikov@xxxxxxxxxx>
+
+ [BZ #15366]
+ * sysdeps/generic/inttypes.h (PRId8, PRId16, etc.):
+ define unconditionally.
+ * sysdeps/generic/stdint.h (INT8_MIN, INT16_MIN, etc.):
+ define unconditionally.
+ (INT8_C, INT16_C, etc.): Likewise.
+
+2013-04-25 Maciej W. Rozycki <macro@xxxxxxxxxxxxxxxx>
+
+ * csu/libc-start.c (__libc_start_main) [!SHARED]: Declare
+ __ehdr_start with hidden visibility.
+
+ * soft-fp/op-common.h (_FP_SQRT): s/sNAN/NAN/ in a comment.
+
2013-04-24 Carlos O'Donell <carlos@xxxxxxxxxx>
* math/libm-test.inc (cos_test): Use accurate hex constants.
Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Fri Apr 26 00:01:50 2013
@@ -10,11 +10,11 @@
* The following bugs are resolved with this release:
10060, 10062, 10357, 11120, 11561, 12723, 13550, 13889, 13951, 13988,
- 14142, 14176, 14200, 14293, 14317, 14327, 14478, 14496, 14686, 14812,
- 14888, 14920, 14964, 14981, 14982, 14985, 14994, 14996, 15003, 15006,
- 15020, 15023, 15036, 15054, 15055, 15062, 15078, 15160, 15214, 15232,
- 15234, 15283, 15285, 15287, 15304, 15305, 15307, 15309, 15327, 15330,
- 15335, 15336, 15337, 15342, 15346, 15361, 15394.
+ 14142, 14176, 14200, 14280, 14293, 14317, 14327, 14478, 14496, 14686,
+ 14812, 14888, 14920, 14964, 14981, 14982, 14985, 14994, 14996, 15003,
+ 15006, 15020, 15023, 15036, 15054, 15055, 15062, 15078, 15160, 15214,
+ 15232, 15234, 15283, 15285, 15287, 15304, 15305, 15307, 15309, 15327,
+ 15330, 15335, 15336, 15337, 15342, 15346, 15361, 15366, 15394.
* CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
#15078).
Modified: fsf/trunk/libc/csu/libc-start.c
==============================================================================
--- fsf/trunk/libc/csu/libc-start.c (original)
+++ fsf/trunk/libc/csu/libc-start.c Fri Apr 26 00:01:50 2013
@@ -161,7 +161,8 @@
So we can set up _dl_phdr and _dl_phnum even without any
information from auxv. */
- extern const ElfW(Ehdr) __ehdr_start __attribute__ ((weak));
+ extern const ElfW(Ehdr) __ehdr_start
+ __attribute__ ((weak, visibility ("hidden")));
if (&__ehdr_start != NULL)
{
assert (__ehdr_start.e_phentsize == sizeof *GL(dl_phdr));
Modified: fsf/trunk/libc/elf/Makefile
==============================================================================
--- fsf/trunk/libc/elf/Makefile (original)
+++ fsf/trunk/libc/elf/Makefile Fri Apr 26 00:01:50 2013
@@ -151,12 +151,6 @@
selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null)
ifneq ($(selinux-enabled),1)
tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
-endif
-ifeq (x86_64,$(config-machine))
-tests += tst-audit3 tst-audit4 tst-audit5
-ifeq (yes,$(config-cflags-avx))
-tests += tst-audit6 tst-audit7
-endif
endif
endif
ifeq ($(run-built-tests),yes)
@@ -219,13 +213,6 @@
modules-names += tst-piemod1
tests += tst-pie1
tests-pie += tst-pie1
-endif
-ifeq (x86_64,$(config-machine))
-modules-names += tst-auditmod3a tst-auditmod3b \
- tst-auditmod4a tst-auditmod4b \
- tst-auditmod5a tst-auditmod5b \
- tst-auditmod6a tst-auditmod6b tst-auditmod6c \
- tst-auditmod7a tst-auditmod7b
endif
modules-execstack-yes = tst-execstack-mod
extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
@@ -1001,27 +988,6 @@
$(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so
tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
-$(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so
-$(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so
-tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so
-
-$(objpfx)tst-audit4: $(objpfx)tst-auditmod4a.so
-$(objpfx)tst-audit4.out: $(objpfx)tst-auditmod4b.so
-tst-audit4-ENV = LD_AUDIT=$(objpfx)tst-auditmod4b.so
-
-$(objpfx)tst-audit5: $(objpfx)tst-auditmod5a.so
-$(objpfx)tst-audit5.out: $(objpfx)tst-auditmod5b.so
-tst-audit5-ENV = LD_AUDIT=$(objpfx)tst-auditmod5b.so
-
-$(objpfx)tst-audit6: $(objpfx)tst-auditmod6a.so
-$(objpfx)tst-audit6.out: $(objpfx)tst-auditmod6b.so \
- $(objpfx)tst-auditmod6c.so
-tst-audit6-ENV = LD_AUDIT=$(objpfx)tst-auditmod6b.so:$(objpfx)tst-auditmod6c.so
-
-$(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so
-$(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so
-tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so
-
$(objpfx)tst-audit8: $(common-objpfx)math/libm.so
$(objpfx)tst-audit8.out: $(objpfx)tst-auditmod1.so
tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
@@ -1149,19 +1115,6 @@
$< > $@
cmp $@ tst-initorder2.exp > /dev/null
-ifeq (yes,$(config-cflags-avx))
-AVX-CFLAGS=-mavx
-ifeq (yes,$(config-cflags-novzeroupper))
-AVX-CFLAGS+=-mno-vzeroupper
-endif
-CFLAGS-tst-audit4.c += $(AVX-CFLAGS)
-CFLAGS-tst-auditmod4a.c += $(AVX-CFLAGS)
-CFLAGS-tst-auditmod4b.c += $(AVX-CFLAGS)
-CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS)
-CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
-CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
-endif
-
$(objpfx)tst-relsort1: $(libdl)
$(objpfx)tst-relsort1mod1.so: $(libm) $(objpfx)tst-relsort1mod2.so
$(objpfx)tst-relsort1mod2.so: $(libm)
Removed: fsf/trunk/libc/elf/tst-audit3.c
==============================================================================
--- fsf/trunk/libc/elf/tst-audit3.c (original)
+++ fsf/trunk/libc/elf/tst-audit3.c (removed)
@@ -1,20 +1,0 @@
-/* Test case for x86-64 preserved registers in dynamic linker. */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <emmintrin.h>
-
-extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i,
- __m128i, __m128i, __m128i, __m128i);
-int
-main (void)
-{
- __m128i xmm = _mm_setzero_si128 ();
- __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm);
-
- if (memcmp (&xmm, &ret, sizeof (ret)))
- abort ();
-
- return 0;
-}
Removed: fsf/trunk/libc/elf/tst-audit4.c
==============================================================================
--- fsf/trunk/libc/elf/tst-audit4.c (original)
+++ fsf/trunk/libc/elf/tst-audit4.c (removed)
@@ -1,49 +1,0 @@
-/* Test case for x86-64 preserved registers in dynamic linker. */
-
-#ifdef __AVX__
-#include <stdlib.h>
-#include <string.h>
-#include <cpuid.h>
-#include <immintrin.h>
-
-
-static int
-avx_enabled (void)
-{
- unsigned int eax, ebx, ecx, edx;
-
- if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
- || (ecx & (bit_AVX | bit_OSXSAVE)) != (bit_AVX | bit_OSXSAVE))
- return 0;
-
- /* Check the OS has AVX and SSE saving enabled. */
- asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
-
- return (eax & 6) == 6;
-}
-
-
-extern __m256i audit_test (__m256i, __m256i, __m256i, __m256i,
- __m256i, __m256i, __m256i, __m256i);
-int
-main (void)
-{
- /* Run AVX test only if AVX is supported. */
- if (avx_enabled ())
- {
- __m256i ymm = _mm256_setzero_si256 ();
- __m256i ret = audit_test (ymm, ymm, ymm, ymm, ymm, ymm, ymm, ymm);
-
- ymm = _mm256_set1_epi32 (0x12349876);
- if (memcmp (&ymm, &ret, sizeof (ret)))
- abort ();
- }
- return 0;
-}
-#else
-int
-main (void)
-{
- return 0;
-}
-#endif
Removed: fsf/trunk/libc/elf/tst-audit5.c
==============================================================================
--- fsf/trunk/libc/elf/tst-audit5.c (original)
+++ fsf/trunk/libc/elf/tst-audit5.c (removed)
@@ -1,21 +1,0 @@
-/* Test case for x86-64 preserved registers in dynamic linker. */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <emmintrin.h>
-
-extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i,
- __m128i, __m128i, __m128i, __m128i);
-int
-main (void)
-{
- __m128i xmm = _mm_setzero_si128 ();
- __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm);
-
- xmm = _mm_set1_epi32 (0x12349876);
- if (memcmp (&xmm, &ret, sizeof (ret)))
- abort ();
-
- return 0;
-}
Removed: fsf/trunk/libc/elf/tst-audit6.c
==============================================================================
--- fsf/trunk/libc/elf/tst-audit6.c (original)
+++ fsf/trunk/libc/elf/tst-audit6.c (removed)
@@ -1,42 +1,0 @@
-/* Test case for x86-64 preserved registers in dynamic linker. */
-
-#include <stdlib.h>
-#include <string.h>
-#include <cpuid.h>
-#include <emmintrin.h>
-
-extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i,
- __m128i, __m128i, __m128i, __m128i);
-
-
-static int
-avx_enabled (void)
-{
- unsigned int eax, ebx, ecx, edx;
-
- if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
- || (ecx & (bit_AVX | bit_OSXSAVE)) != (bit_AVX | bit_OSXSAVE))
- return 0;
-
- /* Check the OS has AVX and SSE saving enabled. */
- asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
-
- return (eax & 6) == 6;
-}
-
-
-int
-main (void)
-{
- /* Run AVX test only if AVX is supported. */
- if (avx_enabled ())
- {
- __m128i xmm = _mm_setzero_si128 ();
- __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm);
-
- xmm = _mm_set1_epi32 (0x98abcdef);
- if (memcmp (&xmm, &ret, sizeof (ret)))
- abort ();
- }
- return 0;
-}
Removed: fsf/trunk/libc/elf/tst-audit7.c
==============================================================================
--- fsf/trunk/libc/elf/tst-audit7.c (original)
+++ fsf/trunk/libc/elf/tst-audit7.c (removed)
@@ -1,1 +1,0 @@
-#include "tst-audit6.c"
Removed: fsf/trunk/libc/elf/tst-auditmod3a.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod3a.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod3a.c (removed)
@@ -1,24 +1,0 @@
-/* Test case for x86-64 preserved registers in dynamic linker. */
-
-#include <stdlib.h>
-#include <string.h>
-#include <emmintrin.h>
-
-__m128i
-audit_test (__m128i x0, __m128i x1, __m128i x2, __m128i x3,
- __m128i x4, __m128i x5, __m128i x6, __m128i x7)
-{
- __m128i xmm = _mm_setzero_si128 ();
-
- if (memcmp (&xmm, &x0, sizeof (xmm))
- || memcmp (&xmm, &x1, sizeof (xmm))
- || memcmp (&xmm, &x2, sizeof (xmm))
- || memcmp (&xmm, &x3, sizeof (xmm))
- || memcmp (&xmm, &x4, sizeof (xmm))
- || memcmp (&xmm, &x5, sizeof (xmm))
- || memcmp (&xmm, &x6, sizeof (xmm))
- || memcmp (&xmm, &x7, sizeof (xmm)))
- abort ();
-
- return xmm;
-}
Removed: fsf/trunk/libc/elf/tst-auditmod3b.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod3b.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod3b.c (removed)
@@ -1,151 +1,0 @@
-/* Verify that changing xmm registers in audit library won't affect
- function parameter passing/return. */
-
-#include <dlfcn.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <bits/wordsize.h>
-#include <gnu/lib-names.h>
-#include <emmintrin.h>
-
-unsigned int
-la_version (unsigned int v)
-{
- setlinebuf (stdout);
-
- printf ("version: %u\n", v);
-
- char buf[20];
- sprintf (buf, "%u", v);
-
- return v;
-}
-
-void
-la_activity (uintptr_t *cookie, unsigned int flag)
-{
- if (flag == LA_ACT_CONSISTENT)
- printf ("activity: consistent\n");
- else if (flag == LA_ACT_ADD)
- printf ("activity: add\n");
- else if (flag == LA_ACT_DELETE)
- printf ("activity: delete\n");
- else
- printf ("activity: unknown activity %u\n", flag);
-}
-
-char *
-la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
-{
- char buf[100];
- const char *flagstr;
- if (flag == LA_SER_ORIG)
- flagstr = "LA_SET_ORIG";
- else if (flag == LA_SER_LIBPATH)
- flagstr = "LA_SER_LIBPATH";
- else if (flag == LA_SER_RUNPATH)
- flagstr = "LA_SER_RUNPATH";
- else if (flag == LA_SER_CONFIG)
- flagstr = "LA_SER_CONFIG";
- else if (flag == LA_SER_DEFAULT)
- flagstr = "LA_SER_DEFAULT";
- else if (flag == LA_SER_SECURE)
- flagstr = "LA_SER_SECURE";
- else
- {
- sprintf (buf, "unknown flag %d", flag);
- flagstr = buf;
- }
- printf ("objsearch: %s, %s\n", name, flagstr);
-
- return (char *) name;
-}
-
-unsigned int
-la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
-{
- printf ("objopen: %ld, %s\n", lmid, l->l_name);
-
- return 3;
-}
-
-void
-la_preinit (uintptr_t *cookie)
-{
- printf ("preinit\n");
-}
-
-unsigned int
-la_objclose (uintptr_t *cookie)
-{
- printf ("objclose\n");
- return 0;
-}
-
-uintptr_t
-la_symbind32 (Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, unsigned int *flags, const char *symname)
-{
- printf ("symbind32: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
- return sym->st_value;
-}
-
-uintptr_t
-la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, unsigned int *flags, const char *symname)
-{
- printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
- return sym->st_value;
-}
-
-#include <tst-audit.h>
-
-ElfW(Addr)
-pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, La_regs *regs, unsigned int *flags,
- const char *symname, long int *framesizep)
-{
- printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
- __m128i xmm = _mm_set1_epi32 (-1);
- asm volatile ("movdqa %0, %%xmm0" : : "x" (xmm) : "xmm0" );
- asm volatile ("movdqa %0, %%xmm1" : : "x" (xmm) : "xmm1" );
- asm volatile ("movdqa %0, %%xmm2" : : "x" (xmm) : "xmm2" );
- asm volatile ("movdqa %0, %%xmm3" : : "x" (xmm) : "xmm3" );
- asm volatile ("movdqa %0, %%xmm4" : : "x" (xmm) : "xmm4" );
- asm volatile ("movdqa %0, %%xmm5" : : "x" (xmm) : "xmm5" );
- asm volatile ("movdqa %0, %%xmm6" : : "x" (xmm) : "xmm6" );
- asm volatile ("movdqa %0, %%xmm7" : : "x" (xmm) : "xmm7" );
-
- return sym->st_value;
-}
-
-unsigned int
-pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
- const char *symname)
-{
- printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
- symname, (long int) sym->st_value, ndx,
- (ptrdiff_t) outregs->int_retval);
-
- __m128i xmm = _mm_set1_epi32 (-1);
- asm volatile ("movdqa %0, %%xmm0" : : "x" (xmm) : "xmm0" );
- asm volatile ("movdqa %0, %%xmm1" : : "x" (xmm) : "xmm1" );
- asm volatile ("movdqa %0, %%xmm2" : : "x" (xmm) : "xmm2" );
- asm volatile ("movdqa %0, %%xmm3" : : "x" (xmm) : "xmm3" );
- asm volatile ("movdqa %0, %%xmm4" : : "x" (xmm) : "xmm4" );
- asm volatile ("movdqa %0, %%xmm5" : : "x" (xmm) : "xmm5" );
- asm volatile ("movdqa %0, %%xmm6" : : "x" (xmm) : "xmm6" );
- asm volatile ("movdqa %0, %%xmm7" : : "x" (xmm) : "xmm7" );
-
- return 0;
-}
Removed: fsf/trunk/libc/elf/tst-auditmod4a.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod4a.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod4a.c (removed)
@@ -1,48 +1,0 @@
-/* Test case for x86-64 preserved registers in dynamic linker. */
-
-#ifdef __AVX__
-#include <stdlib.h>
-#include <string.h>
-#include <immintrin.h>
-
-__m256i
-audit_test (__m256i x0, __m256i x1, __m256i x2, __m256i x3,
- __m256i x4, __m256i x5, __m256i x6, __m256i x7)
-{
- __m256i ymm;
-
- ymm = _mm256_set1_epi32 (1);
- if (memcmp (&ymm, &x0, sizeof (ymm)))
- abort ();
-
- ymm = _mm256_set1_epi32 (2);
- if (memcmp (&ymm, &x1, sizeof (ymm)))
- abort ();
-
- ymm = _mm256_set1_epi32 (3);
- if (memcmp (&ymm, &x2, sizeof (ymm)))
- abort ();
-
- ymm = _mm256_set1_epi32 (4);
- if (memcmp (&ymm, &x3, sizeof (ymm)))
- abort ();
-
- ymm = _mm256_set1_epi32 (5);
- if (memcmp (&ymm, &x4, sizeof (ymm)))
- abort ();
-
- ymm = _mm256_set1_epi32 (6);
- if (memcmp (&ymm, &x5, sizeof (ymm)))
- abort ();
-
- ymm = _mm256_set1_epi32 (7);
- if (memcmp (&ymm, &x6, sizeof (ymm)))
- abort ();
-
- ymm = _mm256_set1_epi32 (8);
- if (memcmp (&ymm, &x7, sizeof (ymm)))
- abort ();
-
- return _mm256_setzero_si256 ();
-}
-#endif
Removed: fsf/trunk/libc/elf/tst-auditmod4b.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod4b.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod4b.c (removed)
@@ -1,201 +1,0 @@
-/* Verify that changing AVX registers in audit library won't affect
- function parameter passing/return. */
-
-#include <dlfcn.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <bits/wordsize.h>
-#include <gnu/lib-names.h>
-
-unsigned int
-la_version (unsigned int v)
-{
- setlinebuf (stdout);
-
- printf ("version: %u\n", v);
-
- char buf[20];
- sprintf (buf, "%u", v);
-
- return v;
-}
-
-void
-la_activity (uintptr_t *cookie, unsigned int flag)
-{
- if (flag == LA_ACT_CONSISTENT)
- printf ("activity: consistent\n");
- else if (flag == LA_ACT_ADD)
- printf ("activity: add\n");
- else if (flag == LA_ACT_DELETE)
- printf ("activity: delete\n");
- else
- printf ("activity: unknown activity %u\n", flag);
-}
-
-char *
-la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
-{
- char buf[100];
- const char *flagstr;
- if (flag == LA_SER_ORIG)
- flagstr = "LA_SET_ORIG";
- else if (flag == LA_SER_LIBPATH)
- flagstr = "LA_SER_LIBPATH";
- else if (flag == LA_SER_RUNPATH)
- flagstr = "LA_SER_RUNPATH";
- else if (flag == LA_SER_CONFIG)
- flagstr = "LA_SER_CONFIG";
- else if (flag == LA_SER_DEFAULT)
- flagstr = "LA_SER_DEFAULT";
- else if (flag == LA_SER_SECURE)
- flagstr = "LA_SER_SECURE";
- else
- {
- sprintf (buf, "unknown flag %d", flag);
- flagstr = buf;
- }
- printf ("objsearch: %s, %s\n", name, flagstr);
-
- return (char *) name;
-}
-
-unsigned int
-la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
-{
- printf ("objopen: %ld, %s\n", lmid, l->l_name);
-
- return 3;
-}
-
-void
-la_preinit (uintptr_t *cookie)
-{
- printf ("preinit\n");
-}
-
-unsigned int
-la_objclose (uintptr_t *cookie)
-{
- printf ("objclose\n");
- return 0;
-}
-
-uintptr_t
-la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, unsigned int *flags, const char *symname)
-{
- printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
- return sym->st_value;
-}
-
-#include <tst-audit.h>
-
-#ifdef __AVX__
-#include <immintrin.h>
-#include <cpuid.h>
-
-static int avx = -1;
-
-static inline int
-__attribute ((always_inline))
-check_avx (void)
-{
- if (avx == -1)
- {
- unsigned int eax, ebx, ecx, edx;
-
- if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
- && (ecx & bit_AVX))
- avx = 1;
- else
- avx = 0;
- }
- return avx;
-}
-#else
-#include <emmintrin.h>
-#endif
-
-ElfW(Addr)
-pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, La_regs *regs, unsigned int *flags,
- const char *symname, long int *framesizep)
-{
- printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
-#ifdef __AVX__
- if (check_avx () && strcmp (symname, "audit_test") == 0)
- {
- __m256i zero = _mm256_setzero_si256 ();
- if (memcmp (®s->lr_vector[0], &zero, sizeof (zero))
- || memcmp (®s->lr_vector[1], &zero, sizeof (zero))
- || memcmp (®s->lr_vector[2], &zero, sizeof (zero))
- || memcmp (®s->lr_vector[3], &zero, sizeof (zero))
- || memcmp (®s->lr_vector[4], &zero, sizeof (zero))
- || memcmp (®s->lr_vector[5], &zero, sizeof (zero))
- || memcmp (®s->lr_vector[6], &zero, sizeof (zero))
- || memcmp (®s->lr_vector[7], &zero, sizeof (zero)))
- abort ();
-
- for (int i = 0; i < 8; i++)
- regs->lr_vector[i].ymm[0]
- = (La_x86_64_ymm) _mm256_set1_epi32 (i + 1);
-
- __m256i ymm = _mm256_set1_epi32 (-1);
- asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
- asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
- asm volatile ("vmovdqa %0, %%ymm2" : : "x" (ymm) : "xmm2" );
- asm volatile ("vmovdqa %0, %%ymm3" : : "x" (ymm) : "xmm3" );
- asm volatile ("vmovdqa %0, %%ymm4" : : "x" (ymm) : "xmm4" );
- asm volatile ("vmovdqa %0, %%ymm5" : : "x" (ymm) : "xmm5" );
- asm volatile ("vmovdqa %0, %%ymm6" : : "x" (ymm) : "xmm6" );
- asm volatile ("vmovdqa %0, %%ymm7" : : "x" (ymm) : "xmm7" );
-
- *framesizep = 1024;
- }
-#endif
-
- return sym->st_value;
-}
-
-unsigned int
-pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
- const char *symname)
-{
- printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
- symname, (long int) sym->st_value, ndx,
- (ptrdiff_t) outregs->int_retval);
-
-#ifdef __AVX__
- if (check_avx () && strcmp (symname, "audit_test") == 0)
- {
- __m256i zero = _mm256_setzero_si256 ();
- if (memcmp (&outregs->lrv_vector0, &zero, sizeof (zero)))
- abort ();
-
- for (int i = 0; i < 8; i++)
- {
- __m256i ymm = _mm256_set1_epi32 (i + 1);
- if (memcmp (&inregs->lr_vector[i], &ymm, sizeof (ymm)) != 0)
- abort ();
- }
-
- outregs->lrv_vector0.ymm[0]
- = (La_x86_64_ymm) _mm256_set1_epi32 (0x12349876);
-
- __m256i ymm = _mm256_set1_epi32 (-1);
- asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
- asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
- }
-#endif
-
- return 0;
-}
Removed: fsf/trunk/libc/elf/tst-auditmod5a.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod5a.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod5a.c (removed)
@@ -1,46 +1,0 @@
-/* Test case for x86-64 preserved registers in dynamic linker. */
-
-#include <stdlib.h>
-#include <string.h>
-#include <emmintrin.h>
-
-__m128i
-audit_test (__m128i x0, __m128i x1, __m128i x2, __m128i x3,
- __m128i x4, __m128i x5, __m128i x6, __m128i x7)
-{
- __m128i xmm;
-
- xmm = _mm_set1_epi32 (1);
- if (memcmp (&xmm, &x0, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (2);
- if (memcmp (&xmm, &x1, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (3);
- if (memcmp (&xmm, &x2, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (4);
- if (memcmp (&xmm, &x3, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (5);
- if (memcmp (&xmm, &x4, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (6);
- if (memcmp (&xmm, &x5, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (7);
- if (memcmp (&xmm, &x6, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (8);
- if (memcmp (&xmm, &x7, sizeof (xmm)))
- abort ();
-
- return _mm_setzero_si128 ();
-}
Removed: fsf/trunk/libc/elf/tst-auditmod5b.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod5b.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod5b.c (removed)
@@ -1,173 +1,0 @@
-/* Verify that changing xmm registers in audit library won't affect
- function parameter passing/return. */
-
-#include <dlfcn.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <bits/wordsize.h>
-#include <gnu/lib-names.h>
-#include <emmintrin.h>
-
-unsigned int
-la_version (unsigned int v)
-{
- setlinebuf (stdout);
-
- printf ("version: %u\n", v);
-
- char buf[20];
- sprintf (buf, "%u", v);
-
- return v;
-}
-
-void
-la_activity (uintptr_t *cookie, unsigned int flag)
-{
- if (flag == LA_ACT_CONSISTENT)
- printf ("activity: consistent\n");
- else if (flag == LA_ACT_ADD)
- printf ("activity: add\n");
- else if (flag == LA_ACT_DELETE)
- printf ("activity: delete\n");
- else
- printf ("activity: unknown activity %u\n", flag);
-}
-
-char *
-la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
-{
- char buf[100];
- const char *flagstr;
- if (flag == LA_SER_ORIG)
- flagstr = "LA_SET_ORIG";
- else if (flag == LA_SER_LIBPATH)
- flagstr = "LA_SER_LIBPATH";
- else if (flag == LA_SER_RUNPATH)
- flagstr = "LA_SER_RUNPATH";
- else if (flag == LA_SER_CONFIG)
- flagstr = "LA_SER_CONFIG";
- else if (flag == LA_SER_DEFAULT)
- flagstr = "LA_SER_DEFAULT";
- else if (flag == LA_SER_SECURE)
- flagstr = "LA_SER_SECURE";
- else
- {
- sprintf (buf, "unknown flag %d", flag);
- flagstr = buf;
- }
- printf ("objsearch: %s, %s\n", name, flagstr);
-
- return (char *) name;
-}
-
-unsigned int
-la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
-{
- printf ("objopen: %ld, %s\n", lmid, l->l_name);
-
- return 3;
-}
-
-void
-la_preinit (uintptr_t *cookie)
-{
- printf ("preinit\n");
-}
-
-unsigned int
-la_objclose (uintptr_t *cookie)
-{
- printf ("objclose\n");
- return 0;
-}
-
-uintptr_t
-la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, unsigned int *flags, const char *symname)
-{
- printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
- return sym->st_value;
-}
-
-#include <tst-audit.h>
-
-ElfW(Addr)
-pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, La_regs *regs, unsigned int *flags,
- const char *symname, long int *framesizep)
-{
- printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
- __m128i minusone = _mm_set1_epi32 (-1);
-
- if (strcmp (symname, "audit_test") == 0)
- {
- __m128i zero = _mm_setzero_si128 ();
- if (memcmp (®s->lr_xmm[0], &zero, sizeof (zero))
- || memcmp (®s->lr_xmm[1], &zero, sizeof (zero))
- || memcmp (®s->lr_xmm[2], &zero, sizeof (zero))
- || memcmp (®s->lr_xmm[3], &zero, sizeof (zero))
- || memcmp (®s->lr_xmm[4], &zero, sizeof (zero))
- || memcmp (®s->lr_xmm[5], &zero, sizeof (zero))
- || memcmp (®s->lr_xmm[6], &zero, sizeof (zero))
- || memcmp (®s->lr_xmm[7], &zero, sizeof (zero)))
- abort ();
-
- for (int i = 0; i < 8; i++)
- regs->lr_xmm[i] = (La_x86_64_xmm) _mm_set1_epi32 (i + 1);
-
- *framesizep = 1024;
- }
-
- asm volatile ("movdqa %0, %%xmm0" : : "x" (minusone) : "xmm0" );
- asm volatile ("movdqa %0, %%xmm1" : : "x" (minusone) : "xmm1" );
- asm volatile ("movdqa %0, %%xmm2" : : "x" (minusone) : "xmm2" );
- asm volatile ("movdqa %0, %%xmm3" : : "x" (minusone) : "xmm3" );
- asm volatile ("movdqa %0, %%xmm4" : : "x" (minusone) : "xmm4" );
- asm volatile ("movdqa %0, %%xmm5" : : "x" (minusone) : "xmm5" );
- asm volatile ("movdqa %0, %%xmm6" : : "x" (minusone) : "xmm6" );
- asm volatile ("movdqa %0, %%xmm7" : : "x" (minusone) : "xmm7" );
-
- return sym->st_value;
-}
-
-unsigned int
-pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
- const char *symname)
-{
- printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
- symname, (long int) sym->st_value, ndx,
- (ptrdiff_t) outregs->int_retval);
-
- __m128i xmm;
-
- if (strcmp (symname, "audit_test") == 0)
- {
- __m128i zero = _mm_setzero_si128 ();
- if (memcmp (&outregs->lrv_xmm0, &zero, sizeof (zero)))
- abort ();
-
- for (int i = 0; i < 8; i++)
- {
- xmm = _mm_set1_epi32 (i + 1);
- if (memcmp (&inregs->lr_xmm[i], &xmm, sizeof (xmm)) != 0)
- abort ();
- }
-
- outregs->lrv_xmm0 = (La_x86_64_xmm) _mm_set1_epi32 (0x12349876);
- }
-
- xmm = _mm_set1_epi32 (-1);
- asm volatile ("movdqa %0, %%xmm0" : : "x" (xmm) : "xmm0" );
- asm volatile ("movdqa %0, %%xmm1" : : "x" (xmm) : "xmm1" );
-
- return 0;
-}
Removed: fsf/trunk/libc/elf/tst-auditmod6a.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod6a.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod6a.c (removed)
@@ -1,46 +1,0 @@
-/* Test case for x86-64 preserved registers in dynamic linker. */
-
-#include <stdlib.h>
-#include <string.h>
-#include <emmintrin.h>
-
-__m128i
-audit_test (__m128i x0, __m128i x1, __m128i x2, __m128i x3,
- __m128i x4, __m128i x5, __m128i x6, __m128i x7)
-{
- __m128i xmm;
-
- xmm = _mm_set1_epi32 (0x100);
- if (memcmp (&xmm, &x0, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (0x101);
- if (memcmp (&xmm, &x1, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (0x102);
- if (memcmp (&xmm, &x2, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (0x103);
- if (memcmp (&xmm, &x3, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (0x104);
- if (memcmp (&xmm, &x4, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (0x105);
- if (memcmp (&xmm, &x5, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (0x106);
- if (memcmp (&xmm, &x6, sizeof (xmm)))
- abort ();
-
- xmm = _mm_set1_epi32 (0x107);
- if (memcmp (&xmm, &x7, sizeof (xmm)))
- abort ();
-
- return _mm_setzero_si128 ();
-}
Removed: fsf/trunk/libc/elf/tst-auditmod6b.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod6b.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod6b.c (removed)
@@ -1,215 +1,0 @@
-/* Verify that changing AVX registers in audit library won't affect
- function parameter passing/return. */
-
-#include <dlfcn.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <bits/wordsize.h>
-#include <gnu/lib-names.h>
-
-unsigned int
-la_version (unsigned int v)
-{
- setlinebuf (stdout);
-
- printf ("version: %u\n", v);
-
- char buf[20];
- sprintf (buf, "%u", v);
-
- return v;
-}
-
-void
-la_activity (uintptr_t *cookie, unsigned int flag)
-{
- if (flag == LA_ACT_CONSISTENT)
- printf ("activity: consistent\n");
- else if (flag == LA_ACT_ADD)
- printf ("activity: add\n");
- else if (flag == LA_ACT_DELETE)
- printf ("activity: delete\n");
- else
- printf ("activity: unknown activity %u\n", flag);
-}
-
-char *
-la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
-{
- char buf[100];
- const char *flagstr;
- if (flag == LA_SER_ORIG)
- flagstr = "LA_SET_ORIG";
- else if (flag == LA_SER_LIBPATH)
- flagstr = "LA_SER_LIBPATH";
- else if (flag == LA_SER_RUNPATH)
- flagstr = "LA_SER_RUNPATH";
- else if (flag == LA_SER_CONFIG)
- flagstr = "LA_SER_CONFIG";
- else if (flag == LA_SER_DEFAULT)
- flagstr = "LA_SER_DEFAULT";
- else if (flag == LA_SER_SECURE)
- flagstr = "LA_SER_SECURE";
- else
- {
- sprintf (buf, "unknown flag %d", flag);
- flagstr = buf;
- }
- printf ("objsearch: %s, %s\n", name, flagstr);
-
- return (char *) name;
-}
-
-unsigned int
-la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
-{
- printf ("objopen: %ld, %s\n", lmid, l->l_name);
-
- return 3;
-}
-
-void
-la_preinit (uintptr_t *cookie)
-{
- printf ("preinit\n");
-}
-
-unsigned int
-la_objclose (uintptr_t *cookie)
-{
- printf ("objclose\n");
- return 0;
-}
-
-uintptr_t
-la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, unsigned int *flags, const char *symname)
-{
- printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
- return sym->st_value;
-}
-
-#include <tst-audit.h>
-
-#ifdef __AVX__
-#include <immintrin.h>
-#include <cpuid.h>
-
-static int avx = -1;
-
-static inline int
-__attribute ((always_inline))
-check_avx (void)
-{
- if (avx == -1)
- {
- unsigned int eax, ebx, ecx, edx;
-
- if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
- && (ecx & bit_AVX))
- avx = 1;
- else
- avx = 0;
- }
- return avx;
-}
-#else
-#include <emmintrin.h>
-#endif
-
-ElfW(Addr)
-pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, La_regs *regs, unsigned int *flags,
- const char *symname, long int *framesizep)
-{
- printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
-#ifdef __AVX__
- if (check_avx () && strcmp (symname, "audit_test") == 0)
- {
- int i;
-
- __m128i xmm = _mm_setzero_si128 ();
- for (i = 0; i < 8; i++)
- if (memcmp (®s->lr_xmm[i], &xmm, sizeof (xmm))
- || memcmp (®s->lr_vector[i], &xmm, sizeof (xmm)))
- abort ();
-
- for (i = 0; i < 8; i += 2)
- {
- regs->lr_xmm[i] = (La_x86_64_xmm) _mm_set1_epi32 (i + 1);
- regs->lr_vector[i].xmm[0] = regs->lr_xmm[i];
- regs->lr_vector[i + 1].ymm[0]
- = (La_x86_64_ymm) _mm256_set1_epi32 (i + 2);
- regs->lr_xmm[i + 1] = regs->lr_vector[i + 1].xmm[0];
- }
-
- __m256i ymm = _mm256_set1_epi32 (-1);
- asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
- asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
- asm volatile ("vmovdqa %0, %%ymm2" : : "x" (ymm) : "xmm2" );
- asm volatile ("vmovdqa %0, %%ymm3" : : "x" (ymm) : "xmm3" );
- asm volatile ("vmovdqa %0, %%ymm4" : : "x" (ymm) : "xmm4" );
- asm volatile ("vmovdqa %0, %%ymm5" : : "x" (ymm) : "xmm5" );
- asm volatile ("vmovdqa %0, %%ymm6" : : "x" (ymm) : "xmm6" );
- asm volatile ("vmovdqa %0, %%ymm7" : : "x" (ymm) : "xmm7" );
-
- *framesizep = 1024;
- }
-#endif
-
- return sym->st_value;
-}
-
-unsigned int
-pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
- const char *symname)
-{
- printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
- symname, (long int) sym->st_value, ndx,
- (ptrdiff_t) outregs->int_retval);
-
-#ifdef __AVX__
- if (check_avx () && strcmp (symname, "audit_test") == 0)
- {
- int i;
-
- __m128i xmm = _mm_setzero_si128 ();
- if (memcmp (&outregs->lrv_xmm0, &xmm, sizeof (xmm))
- || memcmp (&outregs->lrv_vector0, &xmm, sizeof (xmm)))
- abort ();
-
- __m256i ymm;
-
- for (i = 0; i < 8; i += 2)
- {
- xmm = _mm_set1_epi32 (i + 0x100);
- if (memcmp (&inregs->lr_xmm[i], &xmm, sizeof (xmm))
- || memcmp (&inregs->lr_vector[i], &xmm, sizeof (xmm)))
- abort ();
-
- ymm = _mm256_set1_epi32 (i + 0x101);
- if (memcmp (&inregs->lr_xmm[i + 1],
- &inregs->lr_vector[i + 1].xmm[0], sizeof (xmm))
- || memcmp (&inregs->lr_vector[i + 1], &ymm, sizeof (ymm)))
- abort ();
- }
-
- outregs->lrv_vector0.ymm[0]
- = (La_x86_64_ymm) _mm256_set1_epi32 (0x12349876);
-
- ymm = _mm256_set1_epi32 (-1);
- asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
- asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
- }
-#endif
-
- return 0;
-}
Removed: fsf/trunk/libc/elf/tst-auditmod6c.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod6c.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod6c.c (removed)
@@ -1,220 +1,0 @@
-/* Verify that changing AVX registers in audit library won't affect
- function parameter passing/return. */
-
-#include <dlfcn.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <bits/wordsize.h>
-#include <gnu/lib-names.h>
-
-unsigned int
-la_version (unsigned int v)
-{
- setlinebuf (stdout);
-
- printf ("version: %u\n", v);
-
- char buf[20];
- sprintf (buf, "%u", v);
-
- return v;
-}
-
-void
-la_activity (uintptr_t *cookie, unsigned int flag)
-{
- if (flag == LA_ACT_CONSISTENT)
- printf ("activity: consistent\n");
- else if (flag == LA_ACT_ADD)
- printf ("activity: add\n");
- else if (flag == LA_ACT_DELETE)
- printf ("activity: delete\n");
- else
- printf ("activity: unknown activity %u\n", flag);
-}
-
-char *
-la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
-{
- char buf[100];
- const char *flagstr;
- if (flag == LA_SER_ORIG)
- flagstr = "LA_SET_ORIG";
- else if (flag == LA_SER_LIBPATH)
- flagstr = "LA_SER_LIBPATH";
- else if (flag == LA_SER_RUNPATH)
- flagstr = "LA_SER_RUNPATH";
- else if (flag == LA_SER_CONFIG)
- flagstr = "LA_SER_CONFIG";
- else if (flag == LA_SER_DEFAULT)
- flagstr = "LA_SER_DEFAULT";
- else if (flag == LA_SER_SECURE)
- flagstr = "LA_SER_SECURE";
- else
- {
- sprintf (buf, "unknown flag %d", flag);
- flagstr = buf;
- }
- printf ("objsearch: %s, %s\n", name, flagstr);
-
- return (char *) name;
-}
-
-unsigned int
-la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
-{
- printf ("objopen: %ld, %s\n", lmid, l->l_name);
-
- return 3;
-}
-
-void
-la_preinit (uintptr_t *cookie)
-{
- printf ("preinit\n");
-}
-
-unsigned int
-la_objclose (uintptr_t *cookie)
-{
- printf ("objclose\n");
- return 0;
-}
-
-uintptr_t
-la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, unsigned int *flags, const char *symname)
-{
- printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
- return sym->st_value;
-}
-
-#include <tst-audit.h>
-
-#ifdef __AVX__
-#include <immintrin.h>
-#include <cpuid.h>
-
-static int avx = -1;
-
-static inline int
-__attribute ((always_inline))
-check_avx (void)
-{
- if (avx == -1)
- {
- unsigned int eax, ebx, ecx, edx;
-
- if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
- && (ecx & bit_AVX))
- avx = 1;
- else
- avx = 0;
- }
- return avx;
-}
-#else
-#include <emmintrin.h>
-#endif
-
-ElfW(Addr)
-pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, La_regs *regs, unsigned int *flags,
- const char *symname, long int *framesizep)
-{
- printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
-#ifdef __AVX__
- if (check_avx () && strcmp (symname, "audit_test") == 0)
- {
- int i;
- __m128i xmm;
- __m256i ymm;
-
- for (i = 0; i < 8; i += 2)
- {
- xmm = _mm_set1_epi32 (i + 1);
- if (memcmp (®s->lr_xmm[i], &xmm, sizeof (xmm))
- || memcmp (®s->lr_vector[i], &xmm, sizeof (xmm)))
- abort ();
- regs->lr_xmm[i] = (La_x86_64_xmm) _mm_set1_epi32 (i + 0x100);
- regs->lr_vector[i].xmm[0] = regs->lr_xmm[i];
-
- ymm = _mm256_set1_epi32 (i + 2);
- if (memcmp (®s->lr_xmm[i + 1],
- ®s->lr_vector[i + 1].xmm[0], sizeof (xmm))
- || memcmp (®s->lr_vector[i + 1], &ymm, sizeof (ymm)))
- abort ();
- regs->lr_vector[i + 1].ymm[0]
- = (La_x86_64_ymm) _mm256_set1_epi32 (i + 0x101);
- regs->lr_xmm[i + 1] = regs->lr_vector[i + 1].xmm[0];
- }
-
- ymm = _mm256_set1_epi32 (-1);
- asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
- asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
- asm volatile ("vmovdqa %0, %%ymm2" : : "x" (ymm) : "xmm2" );
- asm volatile ("vmovdqa %0, %%ymm3" : : "x" (ymm) : "xmm3" );
- asm volatile ("vmovdqa %0, %%ymm4" : : "x" (ymm) : "xmm4" );
- asm volatile ("vmovdqa %0, %%ymm5" : : "x" (ymm) : "xmm5" );
- asm volatile ("vmovdqa %0, %%ymm6" : : "x" (ymm) : "xmm6" );
- asm volatile ("vmovdqa %0, %%ymm7" : : "x" (ymm) : "xmm7" );
-
- *framesizep = 1024;
- }
-#endif
-
- return sym->st_value;
-}
-
-unsigned int
-pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
- const char *symname)
-{
- printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
- symname, (long int) sym->st_value, ndx,
- (ptrdiff_t) outregs->int_retval);
-
-#ifdef __AVX__
- if (check_avx () && strcmp (symname, "audit_test") == 0)
- {
- int i;
-
- __m256i ymm = _mm256_set1_epi32 (0x12349876);;
- if (memcmp (&outregs->lrv_vector0, &ymm, sizeof (ymm)))
- abort ();
-
- __m128i xmm;
-
- for (i = 0; i < 8; i += 2)
- {
- xmm = _mm_set1_epi32 (i + 0x100);
- if (memcmp (&inregs->lr_xmm[i], &xmm, sizeof (xmm))
- || memcmp (&inregs->lr_vector[i], &xmm, sizeof (xmm)))
- abort ();
-
- ymm = _mm256_set1_epi32 (i + 0x101);
- if (memcmp (&inregs->lr_xmm[i + 1],
- &inregs->lr_vector[i + 1].xmm[0], sizeof (xmm))
- || memcmp (&inregs->lr_vector[i + 1], &ymm, sizeof (ymm)))
- abort ();
- }
-
- outregs->lrv_vector0.ymm[0]
- = (La_x86_64_ymm) _mm256_set1_epi32 (0x98abcdef);
-
- ymm = _mm256_set1_epi32 (-1);
- asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
- asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
- }
-#endif
-
- return 0;
-}
Removed: fsf/trunk/libc/elf/tst-auditmod7a.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod7a.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod7a.c (removed)
@@ -1,1 +1,0 @@
-#include "tst-auditmod6a.c"
Removed: fsf/trunk/libc/elf/tst-auditmod7b.c
==============================================================================
--- fsf/trunk/libc/elf/tst-auditmod7b.c (original)
+++ fsf/trunk/libc/elf/tst-auditmod7b.c (removed)
@@ -1,213 +1,0 @@
-/* Verify that changing AVX registers in audit library won't affect
- function parameter passing/return. */
-
-#include <dlfcn.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <bits/wordsize.h>
-#include <gnu/lib-names.h>
-
-unsigned int
-la_version (unsigned int v)
-{
- setlinebuf (stdout);
-
- printf ("version: %u\n", v);
-
- char buf[20];
- sprintf (buf, "%u", v);
-
- return v;
-}
-
-void
-la_activity (uintptr_t *cookie, unsigned int flag)
-{
- if (flag == LA_ACT_CONSISTENT)
- printf ("activity: consistent\n");
- else if (flag == LA_ACT_ADD)
- printf ("activity: add\n");
- else if (flag == LA_ACT_DELETE)
- printf ("activity: delete\n");
- else
- printf ("activity: unknown activity %u\n", flag);
-}
-
-char *
-la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
-{
- char buf[100];
- const char *flagstr;
- if (flag == LA_SER_ORIG)
- flagstr = "LA_SET_ORIG";
- else if (flag == LA_SER_LIBPATH)
- flagstr = "LA_SER_LIBPATH";
- else if (flag == LA_SER_RUNPATH)
- flagstr = "LA_SER_RUNPATH";
- else if (flag == LA_SER_CONFIG)
- flagstr = "LA_SER_CONFIG";
- else if (flag == LA_SER_DEFAULT)
- flagstr = "LA_SER_DEFAULT";
- else if (flag == LA_SER_SECURE)
- flagstr = "LA_SER_SECURE";
- else
- {
- sprintf (buf, "unknown flag %d", flag);
- flagstr = buf;
- }
- printf ("objsearch: %s, %s\n", name, flagstr);
-
- return (char *) name;
-}
-
-unsigned int
-la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
-{
- printf ("objopen: %ld, %s\n", lmid, l->l_name);
-
- return 3;
-}
-
-void
-la_preinit (uintptr_t *cookie)
-{
- printf ("preinit\n");
-}
-
-unsigned int
-la_objclose (uintptr_t *cookie)
-{
- printf ("objclose\n");
- return 0;
-}
-
-uintptr_t
-la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, unsigned int *flags, const char *symname)
-{
- printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
- return sym->st_value;
-}
-
-#include <tst-audit.h>
-
-#ifdef __AVX__
-#include <immintrin.h>
-#include <cpuid.h>
-
-static int avx = -1;
-
-static inline int
-__attribute ((always_inline))
-check_avx (void)
-{
- if (avx == -1)
- {
- unsigned int eax, ebx, ecx, edx;
-
- if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
- && (ecx & bit_AVX))
- avx = 1;
- else
- avx = 0;
- }
- return avx;
-}
-#else
-#include <emmintrin.h>
-#endif
-
-ElfW(Addr)
-pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, La_regs *regs, unsigned int *flags,
- const char *symname, long int *framesizep)
-{
- printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
- symname, (long int) sym->st_value, ndx, *flags);
-
-#ifdef __AVX__
- if (check_avx () && strcmp (symname, "audit_test") == 0)
- {
- int i;
-
- __m128i xmm = _mm_setzero_si128 ();
- for (i = 0; i < 8; i++)
- if (memcmp (®s->lr_xmm[i], &xmm, sizeof (xmm))
- || memcmp (®s->lr_vector[i], &xmm, sizeof (xmm)))
- abort ();
-
- for (i = 0; i < 8; i += 2)
- {
- regs->lr_xmm[i] = (La_x86_64_xmm) _mm_set1_epi32 (i + 0x100);
- regs->lr_vector[i + 1].ymm[0]
- = (La_x86_64_ymm) _mm256_set1_epi32 (i + 0x101);
- }
-
- __m256i ymm = _mm256_set1_epi32 (-1);
- asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
- asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
- asm volatile ("vmovdqa %0, %%ymm2" : : "x" (ymm) : "xmm2" );
- asm volatile ("vmovdqa %0, %%ymm3" : : "x" (ymm) : "xmm3" );
- asm volatile ("vmovdqa %0, %%ymm4" : : "x" (ymm) : "xmm4" );
- asm volatile ("vmovdqa %0, %%ymm5" : : "x" (ymm) : "xmm5" );
- asm volatile ("vmovdqa %0, %%ymm6" : : "x" (ymm) : "xmm6" );
- asm volatile ("vmovdqa %0, %%ymm7" : : "x" (ymm) : "xmm7" );
-
- *framesizep = 1024;
- }
-#endif
-
- return sym->st_value;
-}
-
-unsigned int
-pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
- uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
- const char *symname)
-{
- printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
- symname, (long int) sym->st_value, ndx,
- (ptrdiff_t) outregs->int_retval);
-
-#ifdef __AVX__
- if (check_avx () && strcmp (symname, "audit_test") == 0)
- {
- int i;
-
- __m128i xmm = _mm_setzero_si128 ();
- if (memcmp (&outregs->lrv_xmm0, &xmm, sizeof (xmm))
- || memcmp (&outregs->lrv_vector0, &xmm, sizeof (xmm)))
- abort ();
-
- __m256i ymm;
-
- for (i = 0; i < 8; i += 2)
- {
- xmm = _mm_set1_epi32 (i + 0x100);
- if (memcmp (&inregs->lr_xmm[i], &xmm, sizeof (xmm))
- || memcmp (&inregs->lr_vector[i], &xmm, sizeof (xmm)))
- abort ();
-
- ymm = _mm256_set1_epi32 (i + 0x101);
- if (memcmp (&inregs->lr_xmm[i + 1],
- &inregs->lr_vector[i + 1].xmm[0], sizeof (xmm))
- || memcmp (&inregs->lr_vector[i + 1], &ymm, sizeof (ymm)))
- abort ();
- }
-
- outregs->lrv_vector0.ymm[0]
- = (La_x86_64_ymm) _mm256_set1_epi32 (0x98abcdef);
-
- ymm = _mm256_set1_epi32 (-1);
- asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
- asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
- }
-#endif
-
- return 0;
-}
Modified: fsf/trunk/libc/soft-fp/op-common.h
==============================================================================
--- fsf/trunk/libc/soft-fp/op-common.h (original)
+++ fsf/trunk/libc/soft-fp/op-common.h Fri Apr 26 00:01:50 2013
@@ -973,7 +973,7 @@
R##_s = 0; \
if (X##_s) \
{ \
- R##_c = FP_CLS_NAN; /* sNAN */ \
+ R##_c = FP_CLS_NAN; /* NAN */ \
R##_s = _FP_NANSIGN_##fs; \
_FP_FRAC_SET_##wc(R, _FP_NANFRAC_##fs); \
FP_SET_EXCEPTION(FP_EX_INVALID); \
Modified: fsf/trunk/libc/sysdeps/generic/inttypes.h
==============================================================================
--- fsf/trunk/libc/sysdeps/generic/inttypes.h (original)
+++ fsf/trunk/libc/sysdeps/generic/inttypes.h Fri Apr 26 00:01:50 2013
@@ -40,11 +40,6 @@
# define ____gwchar_t_defined 1
#endif
-
-/* The ISO C99 standard specifies that these macros must only be
- defined if explicitly requested. */
-#if !defined __cplusplus || defined __STDC_FORMAT_MACROS
-
# if __WORDSIZE == 64
# define __PRI64_PREFIX "l"
# define __PRIPTR_PREFIX "l"
@@ -267,8 +262,6 @@
# define SCNuPTR __PRIPTR_PREFIX "u"
# define SCNxPTR __PRIPTR_PREFIX "x"
-#endif /* C++ && format macros */
-
__BEGIN_DECLS
Modified: fsf/trunk/libc/sysdeps/generic/stdint.h
==============================================================================
--- fsf/trunk/libc/sysdeps/generic/stdint.h (original)
+++ fsf/trunk/libc/sysdeps/generic/stdint.h Fri Apr 26 00:01:50 2013
@@ -140,10 +140,6 @@
typedef unsigned long long int uintmax_t;
#endif
-
-/* The ISO C99 standard specifies that in C++ implementations these
- macros should only be defined if explicitly requested. */
-#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
# if __WORDSIZE == 64
# define __INT64_C(c) c ## L
@@ -278,13 +274,6 @@
# define WINT_MIN (0u)
# define WINT_MAX (4294967295u)
-#endif /* C++ && limit macros */
-
-
-/* The ISO C99 standard specifies that in C++ implementations these
- should only be defined if explicitly requested. */
-#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
-
/* Signed. */
# define INT8_C(c) c
# define INT16_C(c) c
@@ -314,6 +303,4 @@
# define UINTMAX_C(c) c ## ULL
# endif
-#endif /* C++ && constant macros */
-
#endif /* stdint.h */
Modified: fsf/trunk/libc/sysdeps/x86_64/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/Makefile (original)
+++ fsf/trunk/libc/sysdeps/x86_64/Makefile Fri Apr 26 00:01:50 2013
@@ -37,6 +37,50 @@
$(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o
$(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
+
+tests += tst-audit3 tst-audit4 tst-audit5
+ifeq (yes,$(config-cflags-avx))
+tests += tst-audit6 tst-audit7
+endif
+modules-names += tst-auditmod3a tst-auditmod3b \
+ tst-auditmod4a tst-auditmod4b \
+ tst-auditmod5a tst-auditmod5b \
+ tst-auditmod6a tst-auditmod6b tst-auditmod6c \
+ tst-auditmod7a tst-auditmod7b
+
+$(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so
+$(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so
+tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so
+
+$(objpfx)tst-audit4: $(objpfx)tst-auditmod4a.so
+$(objpfx)tst-audit4.out: $(objpfx)tst-auditmod4b.so
+tst-audit4-ENV = LD_AUDIT=$(objpfx)tst-auditmod4b.so
+
+$(objpfx)tst-audit5: $(objpfx)tst-auditmod5a.so
+$(objpfx)tst-audit5.out: $(objpfx)tst-auditmod5b.so
+tst-audit5-ENV = LD_AUDIT=$(objpfx)tst-auditmod5b.so
+
+$(objpfx)tst-audit6: $(objpfx)tst-auditmod6a.so
+$(objpfx)tst-audit6.out: $(objpfx)tst-auditmod6b.so \
+ $(objpfx)tst-auditmod6c.so
+tst-audit6-ENV = LD_AUDIT=$(objpfx)tst-auditmod6b.so:$(objpfx)tst-auditmod6c.so
+
+$(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so
+$(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so
+tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so
+
+ifeq (yes,$(config-cflags-avx))
+AVX-CFLAGS=-mavx
+ifeq (yes,$(config-cflags-novzeroupper))
+AVX-CFLAGS+=-mno-vzeroupper
+endif
+CFLAGS-tst-audit4.c += $(AVX-CFLAGS)
+CFLAGS-tst-auditmod4a.c += $(AVX-CFLAGS)
+CFLAGS-tst-auditmod4b.c += $(AVX-CFLAGS)
+CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS)
+CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
+CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
+endif
endif
ifeq ($(subdir),csu)
Added: fsf/trunk/libc/sysdeps/x86_64/tst-audit3.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-audit3.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-audit3.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,20 @@
+/* Test case for x86-64 preserved registers in dynamic linker. */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <emmintrin.h>
+
+extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i,
+ __m128i, __m128i, __m128i, __m128i);
+int
+main (void)
+{
+ __m128i xmm = _mm_setzero_si128 ();
+ __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm);
+
+ if (memcmp (&xmm, &ret, sizeof (ret)))
+ abort ();
+
+ return 0;
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-audit4.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-audit4.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-audit4.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,49 @@
+/* Test case for x86-64 preserved registers in dynamic linker. */
+
+#ifdef __AVX__
+#include <stdlib.h>
+#include <string.h>
+#include <cpuid.h>
+#include <immintrin.h>
+
+
+static int
+avx_enabled (void)
+{
+ unsigned int eax, ebx, ecx, edx;
+
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
+ || (ecx & (bit_AVX | bit_OSXSAVE)) != (bit_AVX | bit_OSXSAVE))
+ return 0;
+
+ /* Check the OS has AVX and SSE saving enabled. */
+ asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
+
+ return (eax & 6) == 6;
+}
+
+
+extern __m256i audit_test (__m256i, __m256i, __m256i, __m256i,
+ __m256i, __m256i, __m256i, __m256i);
+int
+main (void)
+{
+ /* Run AVX test only if AVX is supported. */
+ if (avx_enabled ())
+ {
+ __m256i ymm = _mm256_setzero_si256 ();
+ __m256i ret = audit_test (ymm, ymm, ymm, ymm, ymm, ymm, ymm, ymm);
+
+ ymm = _mm256_set1_epi32 (0x12349876);
+ if (memcmp (&ymm, &ret, sizeof (ret)))
+ abort ();
+ }
+ return 0;
+}
+#else
+int
+main (void)
+{
+ return 0;
+}
+#endif
Added: fsf/trunk/libc/sysdeps/x86_64/tst-audit5.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-audit5.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-audit5.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,21 @@
+/* Test case for x86-64 preserved registers in dynamic linker. */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <emmintrin.h>
+
+extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i,
+ __m128i, __m128i, __m128i, __m128i);
+int
+main (void)
+{
+ __m128i xmm = _mm_setzero_si128 ();
+ __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm);
+
+ xmm = _mm_set1_epi32 (0x12349876);
+ if (memcmp (&xmm, &ret, sizeof (ret)))
+ abort ();
+
+ return 0;
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-audit6.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-audit6.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-audit6.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,42 @@
+/* Test case for x86-64 preserved registers in dynamic linker. */
+
+#include <stdlib.h>
+#include <string.h>
+#include <cpuid.h>
+#include <emmintrin.h>
+
+extern __m128i audit_test (__m128i, __m128i, __m128i, __m128i,
+ __m128i, __m128i, __m128i, __m128i);
+
+
+static int
+avx_enabled (void)
+{
+ unsigned int eax, ebx, ecx, edx;
+
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0
+ || (ecx & (bit_AVX | bit_OSXSAVE)) != (bit_AVX | bit_OSXSAVE))
+ return 0;
+
+ /* Check the OS has AVX and SSE saving enabled. */
+ asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
+
+ return (eax & 6) == 6;
+}
+
+
+int
+main (void)
+{
+ /* Run AVX test only if AVX is supported. */
+ if (avx_enabled ())
+ {
+ __m128i xmm = _mm_setzero_si128 ();
+ __m128i ret = audit_test (xmm, xmm, xmm, xmm, xmm, xmm, xmm, xmm);
+
+ xmm = _mm_set1_epi32 (0x98abcdef);
+ if (memcmp (&xmm, &ret, sizeof (ret)))
+ abort ();
+ }
+ return 0;
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-audit7.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-audit7.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-audit7.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,1 @@
+#include "tst-audit6.c"
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod3a.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod3a.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod3a.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,24 @@
+/* Test case for x86-64 preserved registers in dynamic linker. */
+
+#include <stdlib.h>
+#include <string.h>
+#include <emmintrin.h>
+
+__m128i
+audit_test (__m128i x0, __m128i x1, __m128i x2, __m128i x3,
+ __m128i x4, __m128i x5, __m128i x6, __m128i x7)
+{
+ __m128i xmm = _mm_setzero_si128 ();
+
+ if (memcmp (&xmm, &x0, sizeof (xmm))
+ || memcmp (&xmm, &x1, sizeof (xmm))
+ || memcmp (&xmm, &x2, sizeof (xmm))
+ || memcmp (&xmm, &x3, sizeof (xmm))
+ || memcmp (&xmm, &x4, sizeof (xmm))
+ || memcmp (&xmm, &x5, sizeof (xmm))
+ || memcmp (&xmm, &x6, sizeof (xmm))
+ || memcmp (&xmm, &x7, sizeof (xmm)))
+ abort ();
+
+ return xmm;
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod3b.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod3b.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod3b.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,151 @@
+/* Verify that changing xmm registers in audit library won't affect
+ function parameter passing/return. */
+
+#include <dlfcn.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+#include <gnu/lib-names.h>
+#include <emmintrin.h>
+
+unsigned int
+la_version (unsigned int v)
+{
+ setlinebuf (stdout);
+
+ printf ("version: %u\n", v);
+
+ char buf[20];
+ sprintf (buf, "%u", v);
+
+ return v;
+}
+
+void
+la_activity (uintptr_t *cookie, unsigned int flag)
+{
+ if (flag == LA_ACT_CONSISTENT)
+ printf ("activity: consistent\n");
+ else if (flag == LA_ACT_ADD)
+ printf ("activity: add\n");
+ else if (flag == LA_ACT_DELETE)
+ printf ("activity: delete\n");
+ else
+ printf ("activity: unknown activity %u\n", flag);
+}
+
+char *
+la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
+{
+ char buf[100];
+ const char *flagstr;
+ if (flag == LA_SER_ORIG)
+ flagstr = "LA_SET_ORIG";
+ else if (flag == LA_SER_LIBPATH)
+ flagstr = "LA_SER_LIBPATH";
+ else if (flag == LA_SER_RUNPATH)
+ flagstr = "LA_SER_RUNPATH";
+ else if (flag == LA_SER_CONFIG)
+ flagstr = "LA_SER_CONFIG";
+ else if (flag == LA_SER_DEFAULT)
+ flagstr = "LA_SER_DEFAULT";
+ else if (flag == LA_SER_SECURE)
+ flagstr = "LA_SER_SECURE";
+ else
+ {
+ sprintf (buf, "unknown flag %d", flag);
+ flagstr = buf;
+ }
+ printf ("objsearch: %s, %s\n", name, flagstr);
+
+ return (char *) name;
+}
+
+unsigned int
+la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
+{
+ printf ("objopen: %ld, %s\n", lmid, l->l_name);
+
+ return 3;
+}
+
+void
+la_preinit (uintptr_t *cookie)
+{
+ printf ("preinit\n");
+}
+
+unsigned int
+la_objclose (uintptr_t *cookie)
+{
+ printf ("objclose\n");
+ return 0;
+}
+
+uintptr_t
+la_symbind32 (Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, unsigned int *flags, const char *symname)
+{
+ printf ("symbind32: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+ return sym->st_value;
+}
+
+uintptr_t
+la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, unsigned int *flags, const char *symname)
+{
+ printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+ return sym->st_value;
+}
+
+#include <tst-audit.h>
+
+ElfW(Addr)
+pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, La_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+ __m128i xmm = _mm_set1_epi32 (-1);
+ asm volatile ("movdqa %0, %%xmm0" : : "x" (xmm) : "xmm0" );
+ asm volatile ("movdqa %0, %%xmm1" : : "x" (xmm) : "xmm1" );
+ asm volatile ("movdqa %0, %%xmm2" : : "x" (xmm) : "xmm2" );
+ asm volatile ("movdqa %0, %%xmm3" : : "x" (xmm) : "xmm3" );
+ asm volatile ("movdqa %0, %%xmm4" : : "x" (xmm) : "xmm4" );
+ asm volatile ("movdqa %0, %%xmm5" : : "x" (xmm) : "xmm5" );
+ asm volatile ("movdqa %0, %%xmm6" : : "x" (xmm) : "xmm6" );
+ asm volatile ("movdqa %0, %%xmm7" : : "x" (xmm) : "xmm7" );
+
+ return sym->st_value;
+}
+
+unsigned int
+pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
+ const char *symname)
+{
+ printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
+ symname, (long int) sym->st_value, ndx,
+ (ptrdiff_t) outregs->int_retval);
+
+ __m128i xmm = _mm_set1_epi32 (-1);
+ asm volatile ("movdqa %0, %%xmm0" : : "x" (xmm) : "xmm0" );
+ asm volatile ("movdqa %0, %%xmm1" : : "x" (xmm) : "xmm1" );
+ asm volatile ("movdqa %0, %%xmm2" : : "x" (xmm) : "xmm2" );
+ asm volatile ("movdqa %0, %%xmm3" : : "x" (xmm) : "xmm3" );
+ asm volatile ("movdqa %0, %%xmm4" : : "x" (xmm) : "xmm4" );
+ asm volatile ("movdqa %0, %%xmm5" : : "x" (xmm) : "xmm5" );
+ asm volatile ("movdqa %0, %%xmm6" : : "x" (xmm) : "xmm6" );
+ asm volatile ("movdqa %0, %%xmm7" : : "x" (xmm) : "xmm7" );
+
+ return 0;
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod4a.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod4a.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod4a.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,48 @@
+/* Test case for x86-64 preserved registers in dynamic linker. */
+
+#ifdef __AVX__
+#include <stdlib.h>
+#include <string.h>
+#include <immintrin.h>
+
+__m256i
+audit_test (__m256i x0, __m256i x1, __m256i x2, __m256i x3,
+ __m256i x4, __m256i x5, __m256i x6, __m256i x7)
+{
+ __m256i ymm;
+
+ ymm = _mm256_set1_epi32 (1);
+ if (memcmp (&ymm, &x0, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (2);
+ if (memcmp (&ymm, &x1, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (3);
+ if (memcmp (&ymm, &x2, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (4);
+ if (memcmp (&ymm, &x3, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (5);
+ if (memcmp (&ymm, &x4, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (6);
+ if (memcmp (&ymm, &x5, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (7);
+ if (memcmp (&ymm, &x6, sizeof (ymm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (8);
+ if (memcmp (&ymm, &x7, sizeof (ymm)))
+ abort ();
+
+ return _mm256_setzero_si256 ();
+}
+#endif
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod4b.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod4b.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod4b.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,201 @@
+/* Verify that changing AVX registers in audit library won't affect
+ function parameter passing/return. */
+
+#include <dlfcn.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+#include <gnu/lib-names.h>
+
+unsigned int
+la_version (unsigned int v)
+{
+ setlinebuf (stdout);
+
+ printf ("version: %u\n", v);
+
+ char buf[20];
+ sprintf (buf, "%u", v);
+
+ return v;
+}
+
+void
+la_activity (uintptr_t *cookie, unsigned int flag)
+{
+ if (flag == LA_ACT_CONSISTENT)
+ printf ("activity: consistent\n");
+ else if (flag == LA_ACT_ADD)
+ printf ("activity: add\n");
+ else if (flag == LA_ACT_DELETE)
+ printf ("activity: delete\n");
+ else
+ printf ("activity: unknown activity %u\n", flag);
+}
+
+char *
+la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
+{
+ char buf[100];
+ const char *flagstr;
+ if (flag == LA_SER_ORIG)
+ flagstr = "LA_SET_ORIG";
+ else if (flag == LA_SER_LIBPATH)
+ flagstr = "LA_SER_LIBPATH";
+ else if (flag == LA_SER_RUNPATH)
+ flagstr = "LA_SER_RUNPATH";
+ else if (flag == LA_SER_CONFIG)
+ flagstr = "LA_SER_CONFIG";
+ else if (flag == LA_SER_DEFAULT)
+ flagstr = "LA_SER_DEFAULT";
+ else if (flag == LA_SER_SECURE)
+ flagstr = "LA_SER_SECURE";
+ else
+ {
+ sprintf (buf, "unknown flag %d", flag);
+ flagstr = buf;
+ }
+ printf ("objsearch: %s, %s\n", name, flagstr);
+
+ return (char *) name;
+}
+
+unsigned int
+la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
+{
+ printf ("objopen: %ld, %s\n", lmid, l->l_name);
+
+ return 3;
+}
+
+void
+la_preinit (uintptr_t *cookie)
+{
+ printf ("preinit\n");
+}
+
+unsigned int
+la_objclose (uintptr_t *cookie)
+{
+ printf ("objclose\n");
+ return 0;
+}
+
+uintptr_t
+la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, unsigned int *flags, const char *symname)
+{
+ printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+ return sym->st_value;
+}
+
+#include <tst-audit.h>
+
+#ifdef __AVX__
+#include <immintrin.h>
+#include <cpuid.h>
+
+static int avx = -1;
+
+static inline int
+__attribute ((always_inline))
+check_avx (void)
+{
+ if (avx == -1)
+ {
+ unsigned int eax, ebx, ecx, edx;
+
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
+ && (ecx & bit_AVX))
+ avx = 1;
+ else
+ avx = 0;
+ }
+ return avx;
+}
+#else
+#include <emmintrin.h>
+#endif
+
+ElfW(Addr)
+pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, La_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+#ifdef __AVX__
+ if (check_avx () && strcmp (symname, "audit_test") == 0)
+ {
+ __m256i zero = _mm256_setzero_si256 ();
+ if (memcmp (®s->lr_vector[0], &zero, sizeof (zero))
+ || memcmp (®s->lr_vector[1], &zero, sizeof (zero))
+ || memcmp (®s->lr_vector[2], &zero, sizeof (zero))
+ || memcmp (®s->lr_vector[3], &zero, sizeof (zero))
+ || memcmp (®s->lr_vector[4], &zero, sizeof (zero))
+ || memcmp (®s->lr_vector[5], &zero, sizeof (zero))
+ || memcmp (®s->lr_vector[6], &zero, sizeof (zero))
+ || memcmp (®s->lr_vector[7], &zero, sizeof (zero)))
+ abort ();
+
+ for (int i = 0; i < 8; i++)
+ regs->lr_vector[i].ymm[0]
+ = (La_x86_64_ymm) _mm256_set1_epi32 (i + 1);
+
+ __m256i ymm = _mm256_set1_epi32 (-1);
+ asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
+ asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
+ asm volatile ("vmovdqa %0, %%ymm2" : : "x" (ymm) : "xmm2" );
+ asm volatile ("vmovdqa %0, %%ymm3" : : "x" (ymm) : "xmm3" );
+ asm volatile ("vmovdqa %0, %%ymm4" : : "x" (ymm) : "xmm4" );
+ asm volatile ("vmovdqa %0, %%ymm5" : : "x" (ymm) : "xmm5" );
+ asm volatile ("vmovdqa %0, %%ymm6" : : "x" (ymm) : "xmm6" );
+ asm volatile ("vmovdqa %0, %%ymm7" : : "x" (ymm) : "xmm7" );
+
+ *framesizep = 1024;
+ }
+#endif
+
+ return sym->st_value;
+}
+
+unsigned int
+pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
+ const char *symname)
+{
+ printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
+ symname, (long int) sym->st_value, ndx,
+ (ptrdiff_t) outregs->int_retval);
+
+#ifdef __AVX__
+ if (check_avx () && strcmp (symname, "audit_test") == 0)
+ {
+ __m256i zero = _mm256_setzero_si256 ();
+ if (memcmp (&outregs->lrv_vector0, &zero, sizeof (zero)))
+ abort ();
+
+ for (int i = 0; i < 8; i++)
+ {
+ __m256i ymm = _mm256_set1_epi32 (i + 1);
+ if (memcmp (&inregs->lr_vector[i], &ymm, sizeof (ymm)) != 0)
+ abort ();
+ }
+
+ outregs->lrv_vector0.ymm[0]
+ = (La_x86_64_ymm) _mm256_set1_epi32 (0x12349876);
+
+ __m256i ymm = _mm256_set1_epi32 (-1);
+ asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
+ asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
+ }
+#endif
+
+ return 0;
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod5a.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod5a.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod5a.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,46 @@
+/* Test case for x86-64 preserved registers in dynamic linker. */
+
+#include <stdlib.h>
+#include <string.h>
+#include <emmintrin.h>
+
+__m128i
+audit_test (__m128i x0, __m128i x1, __m128i x2, __m128i x3,
+ __m128i x4, __m128i x5, __m128i x6, __m128i x7)
+{
+ __m128i xmm;
+
+ xmm = _mm_set1_epi32 (1);
+ if (memcmp (&xmm, &x0, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (2);
+ if (memcmp (&xmm, &x1, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (3);
+ if (memcmp (&xmm, &x2, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (4);
+ if (memcmp (&xmm, &x3, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (5);
+ if (memcmp (&xmm, &x4, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (6);
+ if (memcmp (&xmm, &x5, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (7);
+ if (memcmp (&xmm, &x6, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (8);
+ if (memcmp (&xmm, &x7, sizeof (xmm)))
+ abort ();
+
+ return _mm_setzero_si128 ();
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod5b.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod5b.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod5b.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,173 @@
+/* Verify that changing xmm registers in audit library won't affect
+ function parameter passing/return. */
+
+#include <dlfcn.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+#include <gnu/lib-names.h>
+#include <emmintrin.h>
+
+unsigned int
+la_version (unsigned int v)
+{
+ setlinebuf (stdout);
+
+ printf ("version: %u\n", v);
+
+ char buf[20];
+ sprintf (buf, "%u", v);
+
+ return v;
+}
+
+void
+la_activity (uintptr_t *cookie, unsigned int flag)
+{
+ if (flag == LA_ACT_CONSISTENT)
+ printf ("activity: consistent\n");
+ else if (flag == LA_ACT_ADD)
+ printf ("activity: add\n");
+ else if (flag == LA_ACT_DELETE)
+ printf ("activity: delete\n");
+ else
+ printf ("activity: unknown activity %u\n", flag);
+}
+
+char *
+la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
+{
+ char buf[100];
+ const char *flagstr;
+ if (flag == LA_SER_ORIG)
+ flagstr = "LA_SET_ORIG";
+ else if (flag == LA_SER_LIBPATH)
+ flagstr = "LA_SER_LIBPATH";
+ else if (flag == LA_SER_RUNPATH)
+ flagstr = "LA_SER_RUNPATH";
+ else if (flag == LA_SER_CONFIG)
+ flagstr = "LA_SER_CONFIG";
+ else if (flag == LA_SER_DEFAULT)
+ flagstr = "LA_SER_DEFAULT";
+ else if (flag == LA_SER_SECURE)
+ flagstr = "LA_SER_SECURE";
+ else
+ {
+ sprintf (buf, "unknown flag %d", flag);
+ flagstr = buf;
+ }
+ printf ("objsearch: %s, %s\n", name, flagstr);
+
+ return (char *) name;
+}
+
+unsigned int
+la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
+{
+ printf ("objopen: %ld, %s\n", lmid, l->l_name);
+
+ return 3;
+}
+
+void
+la_preinit (uintptr_t *cookie)
+{
+ printf ("preinit\n");
+}
+
+unsigned int
+la_objclose (uintptr_t *cookie)
+{
+ printf ("objclose\n");
+ return 0;
+}
+
+uintptr_t
+la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, unsigned int *flags, const char *symname)
+{
+ printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+ return sym->st_value;
+}
+
+#include <tst-audit.h>
+
+ElfW(Addr)
+pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, La_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+ __m128i minusone = _mm_set1_epi32 (-1);
+
+ if (strcmp (symname, "audit_test") == 0)
+ {
+ __m128i zero = _mm_setzero_si128 ();
+ if (memcmp (®s->lr_xmm[0], &zero, sizeof (zero))
+ || memcmp (®s->lr_xmm[1], &zero, sizeof (zero))
+ || memcmp (®s->lr_xmm[2], &zero, sizeof (zero))
+ || memcmp (®s->lr_xmm[3], &zero, sizeof (zero))
+ || memcmp (®s->lr_xmm[4], &zero, sizeof (zero))
+ || memcmp (®s->lr_xmm[5], &zero, sizeof (zero))
+ || memcmp (®s->lr_xmm[6], &zero, sizeof (zero))
+ || memcmp (®s->lr_xmm[7], &zero, sizeof (zero)))
+ abort ();
+
+ for (int i = 0; i < 8; i++)
+ regs->lr_xmm[i] = (La_x86_64_xmm) _mm_set1_epi32 (i + 1);
+
+ *framesizep = 1024;
+ }
+
+ asm volatile ("movdqa %0, %%xmm0" : : "x" (minusone) : "xmm0" );
+ asm volatile ("movdqa %0, %%xmm1" : : "x" (minusone) : "xmm1" );
+ asm volatile ("movdqa %0, %%xmm2" : : "x" (minusone) : "xmm2" );
+ asm volatile ("movdqa %0, %%xmm3" : : "x" (minusone) : "xmm3" );
+ asm volatile ("movdqa %0, %%xmm4" : : "x" (minusone) : "xmm4" );
+ asm volatile ("movdqa %0, %%xmm5" : : "x" (minusone) : "xmm5" );
+ asm volatile ("movdqa %0, %%xmm6" : : "x" (minusone) : "xmm6" );
+ asm volatile ("movdqa %0, %%xmm7" : : "x" (minusone) : "xmm7" );
+
+ return sym->st_value;
+}
+
+unsigned int
+pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
+ const char *symname)
+{
+ printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
+ symname, (long int) sym->st_value, ndx,
+ (ptrdiff_t) outregs->int_retval);
+
+ __m128i xmm;
+
+ if (strcmp (symname, "audit_test") == 0)
+ {
+ __m128i zero = _mm_setzero_si128 ();
+ if (memcmp (&outregs->lrv_xmm0, &zero, sizeof (zero)))
+ abort ();
+
+ for (int i = 0; i < 8; i++)
+ {
+ xmm = _mm_set1_epi32 (i + 1);
+ if (memcmp (&inregs->lr_xmm[i], &xmm, sizeof (xmm)) != 0)
+ abort ();
+ }
+
+ outregs->lrv_xmm0 = (La_x86_64_xmm) _mm_set1_epi32 (0x12349876);
+ }
+
+ xmm = _mm_set1_epi32 (-1);
+ asm volatile ("movdqa %0, %%xmm0" : : "x" (xmm) : "xmm0" );
+ asm volatile ("movdqa %0, %%xmm1" : : "x" (xmm) : "xmm1" );
+
+ return 0;
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6a.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6a.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6a.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,46 @@
+/* Test case for x86-64 preserved registers in dynamic linker. */
+
+#include <stdlib.h>
+#include <string.h>
+#include <emmintrin.h>
+
+__m128i
+audit_test (__m128i x0, __m128i x1, __m128i x2, __m128i x3,
+ __m128i x4, __m128i x5, __m128i x6, __m128i x7)
+{
+ __m128i xmm;
+
+ xmm = _mm_set1_epi32 (0x100);
+ if (memcmp (&xmm, &x0, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (0x101);
+ if (memcmp (&xmm, &x1, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (0x102);
+ if (memcmp (&xmm, &x2, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (0x103);
+ if (memcmp (&xmm, &x3, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (0x104);
+ if (memcmp (&xmm, &x4, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (0x105);
+ if (memcmp (&xmm, &x5, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (0x106);
+ if (memcmp (&xmm, &x6, sizeof (xmm)))
+ abort ();
+
+ xmm = _mm_set1_epi32 (0x107);
+ if (memcmp (&xmm, &x7, sizeof (xmm)))
+ abort ();
+
+ return _mm_setzero_si128 ();
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6b.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6b.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6b.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,215 @@
+/* Verify that changing AVX registers in audit library won't affect
+ function parameter passing/return. */
+
+#include <dlfcn.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+#include <gnu/lib-names.h>
+
+unsigned int
+la_version (unsigned int v)
+{
+ setlinebuf (stdout);
+
+ printf ("version: %u\n", v);
+
+ char buf[20];
+ sprintf (buf, "%u", v);
+
+ return v;
+}
+
+void
+la_activity (uintptr_t *cookie, unsigned int flag)
+{
+ if (flag == LA_ACT_CONSISTENT)
+ printf ("activity: consistent\n");
+ else if (flag == LA_ACT_ADD)
+ printf ("activity: add\n");
+ else if (flag == LA_ACT_DELETE)
+ printf ("activity: delete\n");
+ else
+ printf ("activity: unknown activity %u\n", flag);
+}
+
+char *
+la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
+{
+ char buf[100];
+ const char *flagstr;
+ if (flag == LA_SER_ORIG)
+ flagstr = "LA_SET_ORIG";
+ else if (flag == LA_SER_LIBPATH)
+ flagstr = "LA_SER_LIBPATH";
+ else if (flag == LA_SER_RUNPATH)
+ flagstr = "LA_SER_RUNPATH";
+ else if (flag == LA_SER_CONFIG)
+ flagstr = "LA_SER_CONFIG";
+ else if (flag == LA_SER_DEFAULT)
+ flagstr = "LA_SER_DEFAULT";
+ else if (flag == LA_SER_SECURE)
+ flagstr = "LA_SER_SECURE";
+ else
+ {
+ sprintf (buf, "unknown flag %d", flag);
+ flagstr = buf;
+ }
+ printf ("objsearch: %s, %s\n", name, flagstr);
+
+ return (char *) name;
+}
+
+unsigned int
+la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
+{
+ printf ("objopen: %ld, %s\n", lmid, l->l_name);
+
+ return 3;
+}
+
+void
+la_preinit (uintptr_t *cookie)
+{
+ printf ("preinit\n");
+}
+
+unsigned int
+la_objclose (uintptr_t *cookie)
+{
+ printf ("objclose\n");
+ return 0;
+}
+
+uintptr_t
+la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, unsigned int *flags, const char *symname)
+{
+ printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+ return sym->st_value;
+}
+
+#include <tst-audit.h>
+
+#ifdef __AVX__
+#include <immintrin.h>
+#include <cpuid.h>
+
+static int avx = -1;
+
+static inline int
+__attribute ((always_inline))
+check_avx (void)
+{
+ if (avx == -1)
+ {
+ unsigned int eax, ebx, ecx, edx;
+
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
+ && (ecx & bit_AVX))
+ avx = 1;
+ else
+ avx = 0;
+ }
+ return avx;
+}
+#else
+#include <emmintrin.h>
+#endif
+
+ElfW(Addr)
+pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, La_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+#ifdef __AVX__
+ if (check_avx () && strcmp (symname, "audit_test") == 0)
+ {
+ int i;
+
+ __m128i xmm = _mm_setzero_si128 ();
+ for (i = 0; i < 8; i++)
+ if (memcmp (®s->lr_xmm[i], &xmm, sizeof (xmm))
+ || memcmp (®s->lr_vector[i], &xmm, sizeof (xmm)))
+ abort ();
+
+ for (i = 0; i < 8; i += 2)
+ {
+ regs->lr_xmm[i] = (La_x86_64_xmm) _mm_set1_epi32 (i + 1);
+ regs->lr_vector[i].xmm[0] = regs->lr_xmm[i];
+ regs->lr_vector[i + 1].ymm[0]
+ = (La_x86_64_ymm) _mm256_set1_epi32 (i + 2);
+ regs->lr_xmm[i + 1] = regs->lr_vector[i + 1].xmm[0];
+ }
+
+ __m256i ymm = _mm256_set1_epi32 (-1);
+ asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
+ asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
+ asm volatile ("vmovdqa %0, %%ymm2" : : "x" (ymm) : "xmm2" );
+ asm volatile ("vmovdqa %0, %%ymm3" : : "x" (ymm) : "xmm3" );
+ asm volatile ("vmovdqa %0, %%ymm4" : : "x" (ymm) : "xmm4" );
+ asm volatile ("vmovdqa %0, %%ymm5" : : "x" (ymm) : "xmm5" );
+ asm volatile ("vmovdqa %0, %%ymm6" : : "x" (ymm) : "xmm6" );
+ asm volatile ("vmovdqa %0, %%ymm7" : : "x" (ymm) : "xmm7" );
+
+ *framesizep = 1024;
+ }
+#endif
+
+ return sym->st_value;
+}
+
+unsigned int
+pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
+ const char *symname)
+{
+ printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
+ symname, (long int) sym->st_value, ndx,
+ (ptrdiff_t) outregs->int_retval);
+
+#ifdef __AVX__
+ if (check_avx () && strcmp (symname, "audit_test") == 0)
+ {
+ int i;
+
+ __m128i xmm = _mm_setzero_si128 ();
+ if (memcmp (&outregs->lrv_xmm0, &xmm, sizeof (xmm))
+ || memcmp (&outregs->lrv_vector0, &xmm, sizeof (xmm)))
+ abort ();
+
+ __m256i ymm;
+
+ for (i = 0; i < 8; i += 2)
+ {
+ xmm = _mm_set1_epi32 (i + 0x100);
+ if (memcmp (&inregs->lr_xmm[i], &xmm, sizeof (xmm))
+ || memcmp (&inregs->lr_vector[i], &xmm, sizeof (xmm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (i + 0x101);
+ if (memcmp (&inregs->lr_xmm[i + 1],
+ &inregs->lr_vector[i + 1].xmm[0], sizeof (xmm))
+ || memcmp (&inregs->lr_vector[i + 1], &ymm, sizeof (ymm)))
+ abort ();
+ }
+
+ outregs->lrv_vector0.ymm[0]
+ = (La_x86_64_ymm) _mm256_set1_epi32 (0x12349876);
+
+ ymm = _mm256_set1_epi32 (-1);
+ asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
+ asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
+ }
+#endif
+
+ return 0;
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6c.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6c.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod6c.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,220 @@
+/* Verify that changing AVX registers in audit library won't affect
+ function parameter passing/return. */
+
+#include <dlfcn.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+#include <gnu/lib-names.h>
+
+unsigned int
+la_version (unsigned int v)
+{
+ setlinebuf (stdout);
+
+ printf ("version: %u\n", v);
+
+ char buf[20];
+ sprintf (buf, "%u", v);
+
+ return v;
+}
+
+void
+la_activity (uintptr_t *cookie, unsigned int flag)
+{
+ if (flag == LA_ACT_CONSISTENT)
+ printf ("activity: consistent\n");
+ else if (flag == LA_ACT_ADD)
+ printf ("activity: add\n");
+ else if (flag == LA_ACT_DELETE)
+ printf ("activity: delete\n");
+ else
+ printf ("activity: unknown activity %u\n", flag);
+}
+
+char *
+la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
+{
+ char buf[100];
+ const char *flagstr;
+ if (flag == LA_SER_ORIG)
+ flagstr = "LA_SET_ORIG";
+ else if (flag == LA_SER_LIBPATH)
+ flagstr = "LA_SER_LIBPATH";
+ else if (flag == LA_SER_RUNPATH)
+ flagstr = "LA_SER_RUNPATH";
+ else if (flag == LA_SER_CONFIG)
+ flagstr = "LA_SER_CONFIG";
+ else if (flag == LA_SER_DEFAULT)
+ flagstr = "LA_SER_DEFAULT";
+ else if (flag == LA_SER_SECURE)
+ flagstr = "LA_SER_SECURE";
+ else
+ {
+ sprintf (buf, "unknown flag %d", flag);
+ flagstr = buf;
+ }
+ printf ("objsearch: %s, %s\n", name, flagstr);
+
+ return (char *) name;
+}
+
+unsigned int
+la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
+{
+ printf ("objopen: %ld, %s\n", lmid, l->l_name);
+
+ return 3;
+}
+
+void
+la_preinit (uintptr_t *cookie)
+{
+ printf ("preinit\n");
+}
+
+unsigned int
+la_objclose (uintptr_t *cookie)
+{
+ printf ("objclose\n");
+ return 0;
+}
+
+uintptr_t
+la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, unsigned int *flags, const char *symname)
+{
+ printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+ return sym->st_value;
+}
+
+#include <tst-audit.h>
+
+#ifdef __AVX__
+#include <immintrin.h>
+#include <cpuid.h>
+
+static int avx = -1;
+
+static inline int
+__attribute ((always_inline))
+check_avx (void)
+{
+ if (avx == -1)
+ {
+ unsigned int eax, ebx, ecx, edx;
+
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
+ && (ecx & bit_AVX))
+ avx = 1;
+ else
+ avx = 0;
+ }
+ return avx;
+}
+#else
+#include <emmintrin.h>
+#endif
+
+ElfW(Addr)
+pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, La_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+#ifdef __AVX__
+ if (check_avx () && strcmp (symname, "audit_test") == 0)
+ {
+ int i;
+ __m128i xmm;
+ __m256i ymm;
+
+ for (i = 0; i < 8; i += 2)
+ {
+ xmm = _mm_set1_epi32 (i + 1);
+ if (memcmp (®s->lr_xmm[i], &xmm, sizeof (xmm))
+ || memcmp (®s->lr_vector[i], &xmm, sizeof (xmm)))
+ abort ();
+ regs->lr_xmm[i] = (La_x86_64_xmm) _mm_set1_epi32 (i + 0x100);
+ regs->lr_vector[i].xmm[0] = regs->lr_xmm[i];
+
+ ymm = _mm256_set1_epi32 (i + 2);
+ if (memcmp (®s->lr_xmm[i + 1],
+ ®s->lr_vector[i + 1].xmm[0], sizeof (xmm))
+ || memcmp (®s->lr_vector[i + 1], &ymm, sizeof (ymm)))
+ abort ();
+ regs->lr_vector[i + 1].ymm[0]
+ = (La_x86_64_ymm) _mm256_set1_epi32 (i + 0x101);
+ regs->lr_xmm[i + 1] = regs->lr_vector[i + 1].xmm[0];
+ }
+
+ ymm = _mm256_set1_epi32 (-1);
+ asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
+ asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
+ asm volatile ("vmovdqa %0, %%ymm2" : : "x" (ymm) : "xmm2" );
+ asm volatile ("vmovdqa %0, %%ymm3" : : "x" (ymm) : "xmm3" );
+ asm volatile ("vmovdqa %0, %%ymm4" : : "x" (ymm) : "xmm4" );
+ asm volatile ("vmovdqa %0, %%ymm5" : : "x" (ymm) : "xmm5" );
+ asm volatile ("vmovdqa %0, %%ymm6" : : "x" (ymm) : "xmm6" );
+ asm volatile ("vmovdqa %0, %%ymm7" : : "x" (ymm) : "xmm7" );
+
+ *framesizep = 1024;
+ }
+#endif
+
+ return sym->st_value;
+}
+
+unsigned int
+pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
+ const char *symname)
+{
+ printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
+ symname, (long int) sym->st_value, ndx,
+ (ptrdiff_t) outregs->int_retval);
+
+#ifdef __AVX__
+ if (check_avx () && strcmp (symname, "audit_test") == 0)
+ {
+ int i;
+
+ __m256i ymm = _mm256_set1_epi32 (0x12349876);;
+ if (memcmp (&outregs->lrv_vector0, &ymm, sizeof (ymm)))
+ abort ();
+
+ __m128i xmm;
+
+ for (i = 0; i < 8; i += 2)
+ {
+ xmm = _mm_set1_epi32 (i + 0x100);
+ if (memcmp (&inregs->lr_xmm[i], &xmm, sizeof (xmm))
+ || memcmp (&inregs->lr_vector[i], &xmm, sizeof (xmm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (i + 0x101);
+ if (memcmp (&inregs->lr_xmm[i + 1],
+ &inregs->lr_vector[i + 1].xmm[0], sizeof (xmm))
+ || memcmp (&inregs->lr_vector[i + 1], &ymm, sizeof (ymm)))
+ abort ();
+ }
+
+ outregs->lrv_vector0.ymm[0]
+ = (La_x86_64_ymm) _mm256_set1_epi32 (0x98abcdef);
+
+ ymm = _mm256_set1_epi32 (-1);
+ asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
+ asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
+ }
+#endif
+
+ return 0;
+}
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod7a.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod7a.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod7a.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,1 @@
+#include "tst-auditmod6a.c"
Added: fsf/trunk/libc/sysdeps/x86_64/tst-auditmod7b.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/tst-auditmod7b.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/tst-auditmod7b.c Fri Apr 26 00:01:50 2013
@@ -1,0 +1,213 @@
+/* Verify that changing AVX registers in audit library won't affect
+ function parameter passing/return. */
+
+#include <dlfcn.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <bits/wordsize.h>
+#include <gnu/lib-names.h>
+
+unsigned int
+la_version (unsigned int v)
+{
+ setlinebuf (stdout);
+
+ printf ("version: %u\n", v);
+
+ char buf[20];
+ sprintf (buf, "%u", v);
+
+ return v;
+}
+
+void
+la_activity (uintptr_t *cookie, unsigned int flag)
+{
+ if (flag == LA_ACT_CONSISTENT)
+ printf ("activity: consistent\n");
+ else if (flag == LA_ACT_ADD)
+ printf ("activity: add\n");
+ else if (flag == LA_ACT_DELETE)
+ printf ("activity: delete\n");
+ else
+ printf ("activity: unknown activity %u\n", flag);
+}
+
+char *
+la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
+{
+ char buf[100];
+ const char *flagstr;
+ if (flag == LA_SER_ORIG)
+ flagstr = "LA_SET_ORIG";
+ else if (flag == LA_SER_LIBPATH)
+ flagstr = "LA_SER_LIBPATH";
+ else if (flag == LA_SER_RUNPATH)
+ flagstr = "LA_SER_RUNPATH";
+ else if (flag == LA_SER_CONFIG)
+ flagstr = "LA_SER_CONFIG";
+ else if (flag == LA_SER_DEFAULT)
+ flagstr = "LA_SER_DEFAULT";
+ else if (flag == LA_SER_SECURE)
+ flagstr = "LA_SER_SECURE";
+ else
+ {
+ sprintf (buf, "unknown flag %d", flag);
+ flagstr = buf;
+ }
+ printf ("objsearch: %s, %s\n", name, flagstr);
+
+ return (char *) name;
+}
+
+unsigned int
+la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
+{
+ printf ("objopen: %ld, %s\n", lmid, l->l_name);
+
+ return 3;
+}
+
+void
+la_preinit (uintptr_t *cookie)
+{
+ printf ("preinit\n");
+}
+
+unsigned int
+la_objclose (uintptr_t *cookie)
+{
+ printf ("objclose\n");
+ return 0;
+}
+
+uintptr_t
+la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, unsigned int *flags, const char *symname)
+{
+ printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+ return sym->st_value;
+}
+
+#include <tst-audit.h>
+
+#ifdef __AVX__
+#include <immintrin.h>
+#include <cpuid.h>
+
+static int avx = -1;
+
+static inline int
+__attribute ((always_inline))
+check_avx (void)
+{
+ if (avx == -1)
+ {
+ unsigned int eax, ebx, ecx, edx;
+
+ if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)
+ && (ecx & bit_AVX))
+ avx = 1;
+ else
+ avx = 0;
+ }
+ return avx;
+}
+#else
+#include <emmintrin.h>
+#endif
+
+ElfW(Addr)
+pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, La_regs *regs, unsigned int *flags,
+ const char *symname, long int *framesizep)
+{
+ printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
+ symname, (long int) sym->st_value, ndx, *flags);
+
+#ifdef __AVX__
+ if (check_avx () && strcmp (symname, "audit_test") == 0)
+ {
+ int i;
+
+ __m128i xmm = _mm_setzero_si128 ();
+ for (i = 0; i < 8; i++)
+ if (memcmp (®s->lr_xmm[i], &xmm, sizeof (xmm))
+ || memcmp (®s->lr_vector[i], &xmm, sizeof (xmm)))
+ abort ();
+
+ for (i = 0; i < 8; i += 2)
+ {
+ regs->lr_xmm[i] = (La_x86_64_xmm) _mm_set1_epi32 (i + 0x100);
+ regs->lr_vector[i + 1].ymm[0]
+ = (La_x86_64_ymm) _mm256_set1_epi32 (i + 0x101);
+ }
+
+ __m256i ymm = _mm256_set1_epi32 (-1);
+ asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
+ asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
+ asm volatile ("vmovdqa %0, %%ymm2" : : "x" (ymm) : "xmm2" );
+ asm volatile ("vmovdqa %0, %%ymm3" : : "x" (ymm) : "xmm3" );
+ asm volatile ("vmovdqa %0, %%ymm4" : : "x" (ymm) : "xmm4" );
+ asm volatile ("vmovdqa %0, %%ymm5" : : "x" (ymm) : "xmm5" );
+ asm volatile ("vmovdqa %0, %%ymm6" : : "x" (ymm) : "xmm6" );
+ asm volatile ("vmovdqa %0, %%ymm7" : : "x" (ymm) : "xmm7" );
+
+ *framesizep = 1024;
+ }
+#endif
+
+ return sym->st_value;
+}
+
+unsigned int
+pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+ uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
+ const char *symname)
+{
+ printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
+ symname, (long int) sym->st_value, ndx,
+ (ptrdiff_t) outregs->int_retval);
+
+#ifdef __AVX__
+ if (check_avx () && strcmp (symname, "audit_test") == 0)
+ {
+ int i;
+
+ __m128i xmm = _mm_setzero_si128 ();
+ if (memcmp (&outregs->lrv_xmm0, &xmm, sizeof (xmm))
+ || memcmp (&outregs->lrv_vector0, &xmm, sizeof (xmm)))
+ abort ();
+
+ __m256i ymm;
+
+ for (i = 0; i < 8; i += 2)
+ {
+ xmm = _mm_set1_epi32 (i + 0x100);
+ if (memcmp (&inregs->lr_xmm[i], &xmm, sizeof (xmm))
+ || memcmp (&inregs->lr_vector[i], &xmm, sizeof (xmm)))
+ abort ();
+
+ ymm = _mm256_set1_epi32 (i + 0x101);
+ if (memcmp (&inregs->lr_xmm[i + 1],
+ &inregs->lr_vector[i + 1].xmm[0], sizeof (xmm))
+ || memcmp (&inregs->lr_vector[i + 1], &ymm, sizeof (ymm)))
+ abort ();
+ }
+
+ outregs->lrv_vector0.ymm[0]
+ = (La_x86_64_ymm) _mm256_set1_epi32 (0x98abcdef);
+
+ ymm = _mm256_set1_epi32 (-1);
+ asm volatile ("vmovdqa %0, %%ymm0" : : "x" (ymm) : "xmm0" );
+ asm volatile ("vmovdqa %0, %%ymm1" : : "x" (ymm) : "xmm1" );
+ }
+#endif
+
+ return 0;
+}
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits