|
Packit Service |
82fcde |
#include <dlfcn.h>
|
|
Packit Service |
82fcde |
#include <link.h>
|
|
Packit Service |
82fcde |
#include <stddef.h>
|
|
Packit Service |
82fcde |
#include <stdint.h>
|
|
Packit Service |
82fcde |
#include <stdio.h>
|
|
Packit Service |
82fcde |
#include <stdlib.h>
|
|
Packit Service |
82fcde |
#include <string.h>
|
|
Packit Service |
82fcde |
#include <unistd.h>
|
|
Packit Service |
82fcde |
#include <bits/wordsize.h>
|
|
Packit Service |
82fcde |
#include <gnu/lib-names.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
unsigned int
|
|
Packit Service |
82fcde |
la_version (unsigned int v)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
setlinebuf (stdout);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
printf ("version: %u\n", v);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
char buf[20];
|
|
Packit Service |
82fcde |
sprintf (buf, "%u", v);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return v;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
void
|
|
Packit Service |
82fcde |
la_activity (uintptr_t *cookie, unsigned int flag)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
if (flag == LA_ACT_CONSISTENT)
|
|
Packit Service |
82fcde |
printf ("activity: consistent\n");
|
|
Packit Service |
82fcde |
else if (flag == LA_ACT_ADD)
|
|
Packit Service |
82fcde |
printf ("activity: add\n");
|
|
Packit Service |
82fcde |
else if (flag == LA_ACT_DELETE)
|
|
Packit Service |
82fcde |
printf ("activity: delete\n");
|
|
Packit Service |
82fcde |
else
|
|
Packit Service |
82fcde |
printf ("activity: unknown activity %u\n", flag);
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
char *
|
|
Packit Service |
82fcde |
la_objsearch (const char *name, uintptr_t *cookie, unsigned int flag)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
char buf[100];
|
|
Packit Service |
82fcde |
const char *flagstr;
|
|
Packit Service |
82fcde |
if (flag == LA_SER_ORIG)
|
|
Packit Service |
82fcde |
flagstr = "LA_SET_ORIG";
|
|
Packit Service |
82fcde |
else if (flag == LA_SER_LIBPATH)
|
|
Packit Service |
82fcde |
flagstr = "LA_SER_LIBPATH";
|
|
Packit Service |
82fcde |
else if (flag == LA_SER_RUNPATH)
|
|
Packit Service |
82fcde |
flagstr = "LA_SER_RUNPATH";
|
|
Packit Service |
82fcde |
else if (flag == LA_SER_CONFIG)
|
|
Packit Service |
82fcde |
flagstr = "LA_SER_CONFIG";
|
|
Packit Service |
82fcde |
else if (flag == LA_SER_DEFAULT)
|
|
Packit Service |
82fcde |
flagstr = "LA_SER_DEFAULT";
|
|
Packit Service |
82fcde |
else if (flag == LA_SER_SECURE)
|
|
Packit Service |
82fcde |
flagstr = "LA_SER_SECURE";
|
|
Packit Service |
82fcde |
else
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
sprintf (buf, "unknown flag %d", flag);
|
|
Packit Service |
82fcde |
flagstr = buf;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
printf ("objsearch: %s, %s\n", name, flagstr);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return (char *) name;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
unsigned int
|
|
Packit Service |
82fcde |
la_objopen (struct link_map *l, Lmid_t lmid, uintptr_t *cookie)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("objopen: %ld, %s\n", lmid, l->l_name);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return 3;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
void
|
|
Packit Service |
82fcde |
la_preinit (uintptr_t *cookie)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("preinit\n");
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
unsigned int
|
|
Packit Service |
82fcde |
la_objclose (uintptr_t *cookie)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("objclose\n");
|
|
Packit Service |
82fcde |
return 0;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
uintptr_t
|
|
Packit Service |
82fcde |
la_symbind32 (Elf32_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
|
Packit Service |
82fcde |
uintptr_t *defcook, unsigned int *flags, const char *symname)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("symbind32: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
|
|
Packit Service |
82fcde |
symname, (long int) sym->st_value, ndx, *flags);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return sym->st_value;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
uintptr_t
|
|
Packit Service |
82fcde |
la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
|
Packit Service |
82fcde |
uintptr_t *defcook, unsigned int *flags, const char *symname)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("symbind64: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
|
|
Packit Service |
82fcde |
symname, (long int) sym->st_value, ndx, *flags);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return sym->st_value;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#include <tst-audit.h>
|
|
Packit Service |
82fcde |
#if (!defined (pltenter) || !defined (pltexit) || !defined (La_regs) \
|
|
Packit Service |
82fcde |
|| !defined (La_retval) || !defined (int_retval))
|
|
Packit Service |
82fcde |
# error "architecture specific code needed in sysdeps/CPU/tst-audit.h"
|
|
Packit Service |
82fcde |
#endif
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
ElfW(Addr)
|
|
Packit Service |
82fcde |
pltenter (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
|
|
Packit Service |
82fcde |
uintptr_t *defcook, La_regs *regs, unsigned int *flags,
|
|
Packit Service |
82fcde |
const char *symname, long int *framesizep)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("pltenter: symname=%s, st_value=%#lx, ndx=%u, flags=%u\n",
|
|
Packit Service |
82fcde |
symname, (long int) sym->st_value, ndx, *flags);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return sym->st_value;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
unsigned int
|
|
Packit Service |
82fcde |
pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
|
|
Packit Service |
82fcde |
uintptr_t *defcook, const La_regs *inregs, La_retval *outregs,
|
|
Packit Service |
82fcde |
const char *symname)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
|
|
Packit Service |
82fcde |
symname, (long int) sym->st_value, ndx,
|
|
Packit Service |
82fcde |
(ptrdiff_t) outregs->int_retval);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return 0;
|
|
Packit Service |
82fcde |
}
|