mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 06:20:06 +00:00
Add x32 support to dynamic linker audit
This commit is contained in:
parent
dcb3398838
commit
c8e43ba739
22
ChangeLog
22
ChangeLog
@ -1,3 +1,25 @@
|
||||
2012-03-21 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* elf/tst-auditmod1.c: Support la_x32_gnu_pltenter and
|
||||
la_x32_gnu_pltexit.
|
||||
(pltexit): Cast int_retval to ptrdiff_t.
|
||||
* elf/tst-auditmod3b.c: Likewise.
|
||||
* elf/tst-auditmod4b.c: Likewise.
|
||||
* elf/tst-auditmod5b.c: Likewise.
|
||||
* elf/tst-auditmod6b.c: Likewise.
|
||||
* elf/tst-auditmod6c.c: Likewise.
|
||||
* elf/tst-auditmod7b.c: Likewise.
|
||||
|
||||
* sysdeps/generic/ldsodefs.h (audit_ifaces): Add x32_gnu_pltenter
|
||||
and x32_gnu_pltexit.
|
||||
|
||||
* sysdeps/x86_64/bits/link.h: Check __x86_64__ instead of
|
||||
__ELF_NATIVE_CLASS.
|
||||
(La_x32_regs): New macro.
|
||||
(La_x32_retval): Likewise.
|
||||
(la_x32_gnu_pltenter): New function prototype.
|
||||
(la_x32_gnu_pltexit): Likewise.
|
||||
|
||||
2012-03-21 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
* sysdeps/ieee754/ldbl-128ibm/e_powl.c (huge, tiny): Correct
|
||||
|
@ -109,10 +109,17 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
# define La_retval La_i86_retval
|
||||
# define int_retval lrv_eax
|
||||
#elif defined __x86_64__
|
||||
# define pltenter la_x86_64_gnu_pltenter
|
||||
# define pltexit la_x86_64_gnu_pltexit
|
||||
# define La_regs La_x86_64_regs
|
||||
# define La_retval La_x86_64_retval
|
||||
# ifdef __LP64__
|
||||
# define pltenter la_x86_64_gnu_pltenter
|
||||
# define pltexit la_x86_64_gnu_pltexit
|
||||
# define La_regs La_x86_64_regs
|
||||
# define La_retval La_x86_64_retval
|
||||
# else
|
||||
# define pltenter la_x32_gnu_pltenter
|
||||
# define pltexit la_x32_gnu_pltexit
|
||||
# define La_regs La_x32_regs
|
||||
# define La_retval La_x32_retval
|
||||
# endif
|
||||
# define int_retval lrv_rax
|
||||
#elif defined __powerpc__ && __WORDSIZE == 32
|
||||
# define pltenter la_ppc32_gnu_pltenter
|
||||
@ -188,7 +195,8 @@ pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
const char *symname)
|
||||
{
|
||||
printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
|
||||
symname, (long int) sym->st_value, ndx, outregs->int_retval);
|
||||
symname, (long int) sym->st_value, ndx,
|
||||
(ptrdiff_t) outregs->int_retval);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -105,10 +105,17 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
return sym->st_value;
|
||||
}
|
||||
|
||||
#define pltenter la_x86_64_gnu_pltenter
|
||||
#define pltexit la_x86_64_gnu_pltexit
|
||||
#define La_regs La_x86_64_regs
|
||||
#define La_retval La_x86_64_retval
|
||||
#ifdef __LP64__
|
||||
# define pltenter la_x86_64_gnu_pltenter
|
||||
# define pltexit la_x86_64_gnu_pltexit
|
||||
# define La_regs La_x86_64_regs
|
||||
# define La_retval La_x86_64_retval
|
||||
#else
|
||||
# define pltenter la_x32_gnu_pltenter
|
||||
# define pltexit la_x32_gnu_pltexit
|
||||
# define La_regs La_x32_regs
|
||||
# define La_retval La_x32_retval
|
||||
#endif
|
||||
#define int_retval lrv_rax
|
||||
|
||||
#include <tst-audit.h>
|
||||
@ -140,7 +147,8 @@ pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
const char *symname)
|
||||
{
|
||||
printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
|
||||
symname, (long int) sym->st_value, ndx, outregs->int_retval);
|
||||
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" );
|
||||
|
@ -94,10 +94,17 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
return sym->st_value;
|
||||
}
|
||||
|
||||
#define pltenter la_x86_64_gnu_pltenter
|
||||
#define pltexit la_x86_64_gnu_pltexit
|
||||
#define La_regs La_x86_64_regs
|
||||
#define La_retval La_x86_64_retval
|
||||
#ifdef __LP64__
|
||||
# define pltenter la_x86_64_gnu_pltenter
|
||||
# define pltexit la_x86_64_gnu_pltexit
|
||||
# define La_regs La_x86_64_regs
|
||||
# define La_retval La_x86_64_retval
|
||||
#else
|
||||
# define pltenter la_x32_gnu_pltenter
|
||||
# define pltexit la_x32_gnu_pltexit
|
||||
# define La_regs La_x32_regs
|
||||
# define La_retval La_x32_retval
|
||||
#endif
|
||||
#define int_retval lrv_rax
|
||||
|
||||
#include <tst-audit.h>
|
||||
@ -177,7 +184,8 @@ pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
const char *symname)
|
||||
{
|
||||
printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
|
||||
symname, (long int) sym->st_value, ndx, outregs->int_retval);
|
||||
symname, (long int) sym->st_value, ndx,
|
||||
(ptrdiff_t) outregs->int_retval);
|
||||
|
||||
#ifdef __AVX__
|
||||
if (check_avx () && strcmp (symname, "audit_test") == 0)
|
||||
|
@ -95,10 +95,17 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
return sym->st_value;
|
||||
}
|
||||
|
||||
#define pltenter la_x86_64_gnu_pltenter
|
||||
#define pltexit la_x86_64_gnu_pltexit
|
||||
#define La_regs La_x86_64_regs
|
||||
#define La_retval La_x86_64_retval
|
||||
#ifdef __LP64__
|
||||
# define pltenter la_x86_64_gnu_pltenter
|
||||
# define pltexit la_x86_64_gnu_pltexit
|
||||
# define La_regs La_x86_64_regs
|
||||
# define La_retval La_x86_64_retval
|
||||
#else
|
||||
# define pltenter la_x32_gnu_pltenter
|
||||
# define pltexit la_x32_gnu_pltexit
|
||||
# define La_regs La_x32_regs
|
||||
# define La_retval La_x32_retval
|
||||
#endif
|
||||
#define int_retval lrv_rax
|
||||
|
||||
#include <tst-audit.h>
|
||||
@ -150,7 +157,8 @@ pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
const char *symname)
|
||||
{
|
||||
printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
|
||||
symname, (long int) sym->st_value, ndx, outregs->int_retval);
|
||||
symname, (long int) sym->st_value, ndx,
|
||||
(ptrdiff_t) outregs->int_retval);
|
||||
|
||||
__m128i xmm;
|
||||
|
||||
|
@ -94,10 +94,17 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
return sym->st_value;
|
||||
}
|
||||
|
||||
#define pltenter la_x86_64_gnu_pltenter
|
||||
#define pltexit la_x86_64_gnu_pltexit
|
||||
#define La_regs La_x86_64_regs
|
||||
#define La_retval La_x86_64_retval
|
||||
#ifdef __LP64__
|
||||
# define pltenter la_x86_64_gnu_pltenter
|
||||
# define pltexit la_x86_64_gnu_pltexit
|
||||
# define La_regs La_x86_64_regs
|
||||
# define La_retval La_x86_64_retval
|
||||
#else
|
||||
# define pltenter la_x32_gnu_pltenter
|
||||
# define pltexit la_x32_gnu_pltexit
|
||||
# define La_regs La_x32_regs
|
||||
# define La_retval La_x32_retval
|
||||
#endif
|
||||
#define int_retval lrv_rax
|
||||
|
||||
#include <tst-audit.h>
|
||||
@ -179,7 +186,8 @@ pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
const char *symname)
|
||||
{
|
||||
printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
|
||||
symname, (long int) sym->st_value, ndx, outregs->int_retval);
|
||||
symname, (long int) sym->st_value, ndx,
|
||||
(ptrdiff_t) outregs->int_retval);
|
||||
|
||||
#ifdef __AVX__
|
||||
if (check_avx () && strcmp (symname, "audit_test") == 0)
|
||||
|
@ -94,10 +94,17 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
return sym->st_value;
|
||||
}
|
||||
|
||||
#define pltenter la_x86_64_gnu_pltenter
|
||||
#define pltexit la_x86_64_gnu_pltexit
|
||||
#define La_regs La_x86_64_regs
|
||||
#define La_retval La_x86_64_retval
|
||||
#ifdef __LP64__
|
||||
# define pltenter la_x86_64_gnu_pltenter
|
||||
# define pltexit la_x86_64_gnu_pltexit
|
||||
# define La_regs La_x86_64_regs
|
||||
# define La_retval La_x86_64_retval
|
||||
#else
|
||||
# define pltenter la_x32_gnu_pltenter
|
||||
# define pltexit la_x32_gnu_pltexit
|
||||
# define La_regs La_x32_regs
|
||||
# define La_retval La_x32_retval
|
||||
#endif
|
||||
#define int_retval lrv_rax
|
||||
|
||||
#include <tst-audit.h>
|
||||
@ -185,7 +192,8 @@ pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
const char *symname)
|
||||
{
|
||||
printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
|
||||
symname, (long int) sym->st_value, ndx, outregs->int_retval);
|
||||
symname, (long int) sym->st_value, ndx,
|
||||
(ptrdiff_t) outregs->int_retval);
|
||||
|
||||
#ifdef __AVX__
|
||||
if (check_avx () && strcmp (symname, "audit_test") == 0)
|
||||
|
@ -94,10 +94,17 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
return sym->st_value;
|
||||
}
|
||||
|
||||
#define pltenter la_x86_64_gnu_pltenter
|
||||
#define pltexit la_x86_64_gnu_pltexit
|
||||
#define La_regs La_x86_64_regs
|
||||
#define La_retval La_x86_64_retval
|
||||
#ifdef __LP64__
|
||||
# define pltenter la_x86_64_gnu_pltenter
|
||||
# define pltexit la_x86_64_gnu_pltexit
|
||||
# define La_regs La_x86_64_regs
|
||||
# define La_retval La_x86_64_retval
|
||||
#else
|
||||
# define pltenter la_x32_gnu_pltenter
|
||||
# define pltexit la_x32_gnu_pltexit
|
||||
# define La_regs La_x32_regs
|
||||
# define La_retval La_x32_retval
|
||||
#endif
|
||||
#define int_retval lrv_rax
|
||||
|
||||
#include <tst-audit.h>
|
||||
@ -177,7 +184,8 @@ pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
|
||||
const char *symname)
|
||||
{
|
||||
printf ("pltexit: symname=%s, st_value=%#lx, ndx=%u, retval=%tu\n",
|
||||
symname, (long int) sym->st_value, ndx, outregs->int_retval);
|
||||
symname, (long int) sym->st_value, ndx,
|
||||
(ptrdiff_t) outregs->int_retval);
|
||||
|
||||
#ifdef __AVX__
|
||||
if (check_avx () && strcmp (symname, "audit_test") == 0)
|
||||
|
@ -225,6 +225,10 @@ struct audit_ifaces
|
||||
uintptr_t *, struct La_x86_64_regs *,
|
||||
unsigned int *, const char *name,
|
||||
long int *framesizep);
|
||||
Elf32_Addr (*x32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
|
||||
uintptr_t *, struct La_x32_regs *,
|
||||
unsigned int *, const char *name,
|
||||
long int *framesizep);
|
||||
Elf32_Addr (*ppc32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *,
|
||||
uintptr_t *, struct La_ppc32_regs *,
|
||||
unsigned int *, const char *name,
|
||||
@ -269,6 +273,11 @@ struct audit_ifaces
|
||||
const struct La_x86_64_regs *,
|
||||
struct La_x86_64_retval *,
|
||||
const char *);
|
||||
unsigned int (*x32_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *,
|
||||
uintptr_t *,
|
||||
const struct La_x32_regs *,
|
||||
struct La_x86_64_retval *,
|
||||
const char *);
|
||||
unsigned int (*ppc32_gnu_pltexit) (Elf32_Sym *, unsigned int, uintptr_t *,
|
||||
uintptr_t *,
|
||||
const struct La_ppc32_regs *,
|
||||
|
@ -20,7 +20,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if __ELF_NATIVE_CLASS == 32
|
||||
#ifndef __x86_64__
|
||||
/* Registers for entry into PLT on IA-32. */
|
||||
typedef struct La_i86_regs
|
||||
{
|
||||
@ -105,6 +105,8 @@ typedef struct La_x86_64_retval
|
||||
La_x86_64_vector lrv_vector1;
|
||||
} La_x86_64_retval;
|
||||
|
||||
#define La_x32_regs La_x86_64_regs
|
||||
#define La_x32_retval La_x86_64_retval
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
@ -124,6 +126,22 @@ extern unsigned int la_x86_64_gnu_pltexit (Elf64_Sym *__sym,
|
||||
La_x86_64_retval *__outregs,
|
||||
const char *__symname);
|
||||
|
||||
extern Elf32_Addr la_x32_gnu_pltenter (Elf32_Sym *__sym,
|
||||
unsigned int __ndx,
|
||||
uintptr_t *__refcook,
|
||||
uintptr_t *__defcook,
|
||||
La_x32_regs *__regs,
|
||||
unsigned int *__flags,
|
||||
const char *__symname,
|
||||
long int *__framesizep);
|
||||
extern unsigned int la_x32_gnu_pltexit (Elf32_Sym *__sym,
|
||||
unsigned int __ndx,
|
||||
uintptr_t *__refcook,
|
||||
uintptr_t *__defcook,
|
||||
const La_x32_regs *__inregs,
|
||||
La_x32_retval *__outregs,
|
||||
const char *__symname);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user