7 #include <bits/wordsize.h>
8 #include <gnu/lib-names.h>
12 la_version (unsigned int v
)
16 printf ("version: %u\n", v
);
19 sprintf (buf
, "%u", v
);
25 la_activity (uintptr_t *cookie
, unsigned int flag
)
27 if (flag
== LA_ACT_CONSISTENT
)
28 printf ("activity: consistent\n");
29 else if (flag
== LA_ACT_ADD
)
30 printf ("activity: add\n");
31 else if (flag
== LA_ACT_DELETE
)
32 printf ("activity: delete\n");
34 printf ("activity: unknown activity %u\n", flag
);
38 la_objsearch (const char *name
, uintptr_t *cookie
, unsigned int flag
)
42 if (flag
== LA_SER_ORIG
)
43 flagstr
= "LA_SET_ORIG";
44 else if (flag
== LA_SER_LIBPATH
)
45 flagstr
= "LA_SER_LIBPATH";
46 else if (flag
== LA_SER_RUNPATH
)
47 flagstr
= "LA_SER_RUNPATH";
48 else if (flag
== LA_SER_CONFIG
)
49 flagstr
= "LA_SER_CONFIG";
50 else if (flag
== LA_SER_DEFAULT
)
51 flagstr
= "LA_SER_DEFAULT";
52 else if (flag
== LA_SER_SECURE
)
53 flagstr
= "LA_SER_SECURE";
56 sprintf (buf
, "unknown flag %d", flag
);
59 printf ("objsearch: %s, %s\n", name
, flagstr
);
65 la_objopen (struct link_map
*l
, Lmid_t lmid
, uintptr_t *cookie
)
67 printf ("objopen: %ld, %s\n", lmid
, l
->l_name
);
73 la_preinit (uintptr_t *cookie
)
79 la_objclose (uintptr_t *cookie
)
81 printf ("objclose\n");
86 la_symbind32 (Elf32_Sym
*sym
, unsigned int ndx
, uintptr_t *refcook
,
87 uintptr_t *defcook
, unsigned int *flags
, const char *symname
)
89 printf ("symbind32: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
90 symname
, (long int) sym
->st_value
, ndx
, *flags
);
96 la_symbind64 (Elf64_Sym
*sym
, unsigned int ndx
, uintptr_t *refcook
,
97 uintptr_t *defcook
, unsigned int *flags
, const char *symname
)
99 printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
100 symname
, (long int) sym
->st_value
, ndx
, *flags
);
102 return sym
->st_value
;
105 #include <tst-audit.h>
106 #if (!defined (pltenter) || !defined (pltexit) || !defined (La_regs) \
107 || !defined (La_retval) || !defined (int_retval))
108 # error "architecture specific code needed in sysdeps/CPU/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 return sym
->st_value
;
124 pltexit (ElfW(Sym
) *sym
, unsigned int ndx
, uintptr_t *refcook
,
125 uintptr_t *defcook
, const La_regs
*inregs
, La_retval
*outregs
,
128 printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
129 symname
, (long int) sym
->st_value
, ndx
,
130 (ptrdiff_t) outregs
->int_retval
);