1 /* Verify that changing xmm registers in audit library won't affect
2 function parameter passing/return. */
12 #include <bits/wordsize.h>
13 #include <gnu/lib-names.h>
14 #include <emmintrin.h>
17 la_version (unsigned int v
)
21 printf ("version: %u\n", v
);
24 sprintf (buf
, "%u", v
);
30 la_activity (uintptr_t *cookie
, unsigned int flag
)
32 if (flag
== LA_ACT_CONSISTENT
)
33 printf ("activity: consistent\n");
34 else if (flag
== LA_ACT_ADD
)
35 printf ("activity: add\n");
36 else if (flag
== LA_ACT_DELETE
)
37 printf ("activity: delete\n");
39 printf ("activity: unknown activity %u\n", flag
);
43 la_objsearch (const char *name
, uintptr_t *cookie
, unsigned int flag
)
47 if (flag
== LA_SER_ORIG
)
48 flagstr
= "LA_SET_ORIG";
49 else if (flag
== LA_SER_LIBPATH
)
50 flagstr
= "LA_SER_LIBPATH";
51 else if (flag
== LA_SER_RUNPATH
)
52 flagstr
= "LA_SER_RUNPATH";
53 else if (flag
== LA_SER_CONFIG
)
54 flagstr
= "LA_SER_CONFIG";
55 else if (flag
== LA_SER_DEFAULT
)
56 flagstr
= "LA_SER_DEFAULT";
57 else if (flag
== LA_SER_SECURE
)
58 flagstr
= "LA_SER_SECURE";
61 sprintf (buf
, "unknown flag %d", flag
);
64 printf ("objsearch: %s, %s\n", name
, flagstr
);
70 la_objopen (struct link_map
*l
, Lmid_t lmid
, uintptr_t *cookie
)
72 printf ("objopen: %ld, %s\n", lmid
, l
->l_name
);
78 la_preinit (uintptr_t *cookie
)
84 la_objclose (uintptr_t *cookie
)
86 printf ("objclose\n");
91 la_symbind32 (Elf32_Sym
*sym
, unsigned int ndx
, uintptr_t *refcook
,
92 uintptr_t *defcook
, unsigned int *flags
, const char *symname
)
94 printf ("symbind32: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
95 symname
, (long int) sym
->st_value
, ndx
, *flags
);
101 la_symbind64 (Elf64_Sym
*sym
, unsigned int ndx
, uintptr_t *refcook
,
102 uintptr_t *defcook
, unsigned int *flags
, const char *symname
)
104 printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
105 symname
, (long int) sym
->st_value
, ndx
, *flags
);
107 return sym
->st_value
;
110 #include <tst-audit.h>
113 pltenter (ElfW(Sym
) *sym
, unsigned int ndx
, uintptr_t *refcook
,
114 uintptr_t *defcook
, La_regs
*regs
, unsigned int *flags
,
115 const char *symname
, long int *framesizep
)
117 printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
118 symname
, (long int) sym
->st_value
, ndx
, *flags
);
120 __m128i xmm
= _mm_set1_epi32 (-1);
121 asm volatile ("movdqa %0, %%xmm0" : : "x" (xmm
) : "xmm0" );
122 asm volatile ("movdqa %0, %%xmm1" : : "x" (xmm
) : "xmm1" );
123 asm volatile ("movdqa %0, %%xmm2" : : "x" (xmm
) : "xmm2" );
124 asm volatile ("movdqa %0, %%xmm3" : : "x" (xmm
) : "xmm3" );
125 asm volatile ("movdqa %0, %%xmm4" : : "x" (xmm
) : "xmm4" );
126 asm volatile ("movdqa %0, %%xmm5" : : "x" (xmm
) : "xmm5" );
127 asm volatile ("movdqa %0, %%xmm6" : : "x" (xmm
) : "xmm6" );
128 asm volatile ("movdqa %0, %%xmm7" : : "x" (xmm
) : "xmm7" );
130 return sym
->st_value
;
134 pltexit (ElfW(Sym
) *sym
, unsigned int ndx
, uintptr_t *refcook
,
135 uintptr_t *defcook
, const La_regs
*inregs
, La_retval
*outregs
,
138 printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
139 symname
, (long int) sym
->st_value
, ndx
,
140 (ptrdiff_t) outregs
->int_retval
);
142 __m128i xmm
= _mm_set1_epi32 (-1);
143 asm volatile ("movdqa %0, %%xmm0" : : "x" (xmm
) : "xmm0" );
144 asm volatile ("movdqa %0, %%xmm1" : : "x" (xmm
) : "xmm1" );
145 asm volatile ("movdqa %0, %%xmm2" : : "x" (xmm
) : "xmm2" );
146 asm volatile ("movdqa %0, %%xmm3" : : "x" (xmm
) : "xmm3" );
147 asm volatile ("movdqa %0, %%xmm4" : : "x" (xmm
) : "xmm4" );
148 asm volatile ("movdqa %0, %%xmm5" : : "x" (xmm
) : "xmm5" );
149 asm volatile ("movdqa %0, %%xmm6" : : "x" (xmm
) : "xmm6" );
150 asm volatile ("movdqa %0, %%xmm7" : : "x" (xmm
) : "xmm7" );