diff options
-rw-r--r-- | ChangeLog.x32 | 20 | ||||
-rw-r--r-- | elf/tst-auditmod1.c | 12 | ||||
-rw-r--r-- | elf/tst-auditmod3b.c | 12 | ||||
-rw-r--r-- | elf/tst-auditmod4b.c | 12 | ||||
-rw-r--r-- | elf/tst-auditmod5b.c | 12 | ||||
-rw-r--r-- | elf/tst-auditmod6b.c | 12 | ||||
-rw-r--r-- | elf/tst-auditmod6c.c | 12 | ||||
-rw-r--r-- | elf/tst-auditmod7b.c | 12 | ||||
-rw-r--r-- | sysdeps/generic/ldsodefs.h | 9 | ||||
-rw-r--r-- | sysdeps/x86_64/bits/link.h | 18 |
10 files changed, 109 insertions, 22 deletions
diff --git a/ChangeLog.x32 b/ChangeLog.x32 index ad30899fd1..0f6166c5a6 100644 --- a/ChangeLog.x32 +++ b/ChangeLog.x32 @@ -1,5 +1,25 @@ 2011-11-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_gnu_pltenter): New. + (la_x32_gnu_pltexit): Likewise. + +2011-11-21 H.J. Lu <hongjiu.lu@intel.com> + * sysdeps/x86_64/dl-machine.h: Replace Elf64_XXX with ElfW(XXX). Replace ELF64_R_TYPE with ELF32_R_TYPE. (elf_machine_load_address): Use ASM_ADDR. diff --git a/elf/tst-auditmod1.c b/elf/tst-auditmod1.c index 2d39df21e8..15a8e34ac7 100644 --- a/elf/tst-auditmod1.c +++ b/elf/tst-auditmod1.c @@ -109,8 +109,13 @@ 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 +# ifdef __LP64__ +# define pltenter la_x86_64_gnu_pltenter +# define pltexit la_x86_64_gnu_pltexit +# else +# define pltenter la_x32_gnu_pltenter +# define pltexit la_x32_gnu_pltexit +# endif # define La_regs La_x86_64_regs # define La_retval La_x86_64_retval # define int_retval lrv_rax @@ -194,7 +199,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; } diff --git a/elf/tst-auditmod3b.c b/elf/tst-auditmod3b.c index 388ed6e49c..d1bb9b0525 100644 --- a/elf/tst-auditmod3b.c +++ b/elf/tst-auditmod3b.c @@ -105,8 +105,13 @@ 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 +#ifdef __LP64__ +# define pltenter la_x86_64_gnu_pltenter +# define pltexit la_x86_64_gnu_pltexit +#else +# define pltenter la_x32_gnu_pltenter +# define pltexit la_x32_gnu_pltexit +#endif #define La_regs La_x86_64_regs #define La_retval La_x86_64_retval #define int_retval lrv_rax @@ -140,7 +145,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" ); diff --git a/elf/tst-auditmod4b.c b/elf/tst-auditmod4b.c index a6d3c6a6c5..93f107fd26 100644 --- a/elf/tst-auditmod4b.c +++ b/elf/tst-auditmod4b.c @@ -94,8 +94,13 @@ 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 +#ifdef __LP64__ +# define pltenter la_x86_64_gnu_pltenter +# define pltexit la_x86_64_gnu_pltexit +#else +# define pltenter la_x32_gnu_pltenter +# define pltexit la_x32_gnu_pltexit +#endif #define La_regs La_x86_64_regs #define La_retval La_x86_64_retval #define int_retval lrv_rax @@ -177,7 +182,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) diff --git a/elf/tst-auditmod5b.c b/elf/tst-auditmod5b.c index 7e1e941126..78fe8383e4 100644 --- a/elf/tst-auditmod5b.c +++ b/elf/tst-auditmod5b.c @@ -95,8 +95,13 @@ 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 +#ifdef __LP64__ +# define pltenter la_x86_64_gnu_pltenter +# define pltexit la_x86_64_gnu_pltexit +#else +# define pltenter la_x32_gnu_pltenter +# define pltexit la_x32_gnu_pltexit +#endif #define La_regs La_x86_64_regs #define La_retval La_x86_64_retval #define int_retval lrv_rax @@ -150,7 +155,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; diff --git a/elf/tst-auditmod6b.c b/elf/tst-auditmod6b.c index f756b50227..048dd7a4cd 100644 --- a/elf/tst-auditmod6b.c +++ b/elf/tst-auditmod6b.c @@ -94,8 +94,13 @@ 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 +#ifdef __LP64__ +# define pltenter la_x86_64_gnu_pltenter +# define pltexit la_x86_64_gnu_pltexit +#else +# define pltenter la_x32_gnu_pltenter +# define pltexit la_x32_gnu_pltexit +#endif #define La_regs La_x86_64_regs #define La_retval La_x86_64_retval #define int_retval lrv_rax @@ -179,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) diff --git a/elf/tst-auditmod6c.c b/elf/tst-auditmod6c.c index 49cbf05492..81cbaa1d1e 100644 --- a/elf/tst-auditmod6c.c +++ b/elf/tst-auditmod6c.c @@ -94,8 +94,13 @@ 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 +#ifdef __LP64__ +# define pltenter la_x86_64_gnu_pltenter +# define pltexit la_x86_64_gnu_pltexit +#else +# define pltenter la_x32_gnu_pltenter +# define pltexit la_x32_gnu_pltexit +#endif #define La_regs La_x86_64_regs #define La_retval La_x86_64_retval #define int_retval lrv_rax @@ -185,7 +190,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) diff --git a/elf/tst-auditmod7b.c b/elf/tst-auditmod7b.c index eb237586fe..91c4b7a8dd 100644 --- a/elf/tst-auditmod7b.c +++ b/elf/tst-auditmod7b.c @@ -94,8 +94,13 @@ 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 +#ifdef __LP64__ +# define pltenter la_x86_64_gnu_pltenter +# define pltexit la_x86_64_gnu_pltexit +#else +# define pltenter la_x32_gnu_pltenter +# define pltexit la_x32_gnu_pltexit +#endif #define La_regs La_x86_64_regs #define La_retval La_x86_64_retval #define int_retval lrv_rax @@ -177,7 +182,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) diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index d0405903c1..3f8264a0de 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -230,6 +230,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_x86_64_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, @@ -282,6 +286,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_x86_64_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 *, diff --git a/sysdeps/x86_64/bits/link.h b/sysdeps/x86_64/bits/link.h index 643a293bb0..a9cc8e0adb 100644 --- a/sysdeps/x86_64/bits/link.h +++ b/sysdeps/x86_64/bits/link.h @@ -21,7 +21,7 @@ #endif -#if __ELF_NATIVE_CLASS == 32 +#ifndef __x86_64__ /* Registers for entry into PLT on IA-32. */ typedef struct La_i86_regs { @@ -124,6 +124,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_x86_64_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_x86_64_regs *__inregs, + La_x86_64_retval *__outregs, + const char *__symname); + __END_DECLS #endif |