Skip to content

Commit

Permalink
* sysdeps/sparc/sparc32/dl-trampoline.S: New file.
Browse files Browse the repository at this point in the history
	* sysdeps/sparc/sparc32/dl-machine.h: Move PLT trampolines there.
	Use RESOLVE_MAP instead of RESOLVE to protect relocation code.
	(elf_machine_runtime_setup): Test for dl_profile non-null.
	* sysdeps/sparc/sparc64/dl-trampoline.S: New file.
	(ARCH_LA_PLTENTER, ARCH_LA_PLTEXIT): New.
	* sysdeps/sparc/sparc64/dl-machine.h: Move PLT trampolines there.
	Use RESOLVE_MAP instead of RESOLVE to protect relocation code.
	(elf_machine_runtime_setup): Test for dl_profile non-null.
	* sysdeps/sparc/bits/link.h: New file.
	* sysdeps/generic/ldsodefs.h (La_sparc32_regs, La_sparc32_retval,
	La_sparc64_regs, La_sparc64_retval): New.
	(struct audit_ifaces): Add sparc entries.
	* elf/tst-auditmod1.c: Add sparc entries.
  • Loading branch information
Roland McGrath committed Apr 5, 2005
1 parent 328a48c commit 404a4e2
Show file tree
Hide file tree
Showing 8 changed files with 786 additions and 300 deletions.
17 changes: 17 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
2005-04-04 David S. Miller <davem@davemloft.net>

* sysdeps/sparc/sparc32/dl-trampoline.S: New file.
* sysdeps/sparc/sparc32/dl-machine.h: Move PLT trampolines there.
Use RESOLVE_MAP instead of RESOLVE to protect relocation code.
(elf_machine_runtime_setup): Test for dl_profile non-null.
* sysdeps/sparc/sparc64/dl-trampoline.S: New file.
(ARCH_LA_PLTENTER, ARCH_LA_PLTEXIT): New.
* sysdeps/sparc/sparc64/dl-machine.h: Move PLT trampolines there.
Use RESOLVE_MAP instead of RESOLVE to protect relocation code.
(elf_machine_runtime_setup): Test for dl_profile non-null.
* sysdeps/sparc/bits/link.h: New file.
* sysdeps/generic/ldsodefs.h (La_sparc32_regs, La_sparc32_retval,
La_sparc64_regs, La_sparc64_retval): New.
(struct audit_ifaces): Add sparc entries.
* elf/tst-auditmod1.c: Add sparc entries.

2005-03-27 Bruno Haible <bruno@clisp.org>

* intl/tst-gettext3.c: New file.
Expand Down
12 changes: 12 additions & 0 deletions elf/tst-auditmod1.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,18 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
# define La_regs La_mips_64_regs
# define La_retval La_mips_64_retval
# define int_retval lrv_v0
#elif defined __sparc__ && __WORDSIZE == 32
# define pltenter la_sparc32_gnu_pltenter
# define pltexit la_sparc32_gnu_pltexit
# define La_regs La_sparc32_regs
# define La_retval La_sparc32_retval
# define int_retval lrv_reg[0]
#elif defined __sparc__ && __WORDSIZE == 64
# define pltenter la_sparc64_gnu_pltenter
# define pltexit la_sparc64_gnu_pltexit
# define La_regs La_sparc64_regs
# define La_retval La_sparc64_retval
# define int_retval lrv_reg[0]
#else
# error "architecture specific code needed"
#endif
Expand Down
32 changes: 30 additions & 2 deletions sysdeps/generic/ldsodefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ struct La_mips_32_regs;
struct La_mips_32_retval;
struct La_mips_64_regs;
struct La_mips_64_retval;
struct La_sparc32_regs;
struct La_sparc32_retval;
struct La_sparc64_regs;
struct La_sparc64_retval;

struct audit_ifaces
{
Expand Down Expand Up @@ -270,6 +274,16 @@ struct audit_ifaces
const struct La_mips_64_regs *,
unsigned int *, const char *name,
long int *framesizep);
Elf32_Addr (*sparc32_gnu_pltenter) (Elf32_Sym *, unsigned int,
uintptr_t *, uintptr_t *,
const struct La_sparc32_regs *,
unsigned int *, const char *name,
long int *framesizep);
Elf64_Addr (*sparc64_gnu_pltenter) (Elf64_Sym *, unsigned int,
uintptr_t *, uintptr_t *,
const struct La_sparc64_regs *,
unsigned int *, const char *name,
long int *framesizep);
};
union
{
Expand Down Expand Up @@ -328,6 +342,16 @@ struct audit_ifaces
const struct La_mips_64_regs *,
struct La_mips_64_retval *,
const char *);
unsigned int (*sparc32_gnu_pltexit) (Elf32_Sym *, unsigned int,
uintptr_t *, uintptr_t *,
const struct La_sparc32_regs *,
struct La_sparc32_retval *,
const char *);
unsigned int (*sparc64_gnu_pltexit) (Elf64_Sym *, unsigned int,
uintptr_t *, uintptr_t *,
const struct La_sparc32_regs *,
struct La_sparc32_retval *,
const char *);
};
unsigned int (*objclose) (uintptr_t *);

Expand Down Expand Up @@ -587,10 +611,10 @@ struct rtld_global_ro
EXTERN int _dl_correct_cache_id;

/* Mask for hardware capabilities that are available. */
EXTERN unsigned long int _dl_hwcap;
EXTERN uint64_t _dl_hwcap;

/* Mask for important hardware capabilities we honour. */
EXTERN unsigned long int _dl_hwcap_mask;
EXTERN uint64_t _dl_hwcap_mask;

/* Get architecture specific definitions. */
#define PROCINFO_DECL
Expand Down Expand Up @@ -636,6 +660,10 @@ struct rtld_global_ro
/* The vsyscall page is a virtual DSO pre-mapped by the kernel.
This points to its ELF header. */
EXTERN const ElfW(Ehdr) *_dl_sysinfo_dso;

/* At startup time we set up the normal DSO data structure for it,
and this points to it. */
EXTERN struct link_map *_dl_sysinfo_map;
#endif

#ifdef SHARED
Expand Down
100 changes: 100 additions & 0 deletions sysdeps/sparc/bits/link.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/* Machine-specific audit interfaces for dynamic linker. SPARC version.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */

#ifndef _LINK_H
# error "Never include <bits/link.h> directly; use <link.h> instead."
#endif

#if __WORDSIZE == 32

typedef struct La_sparc32_regs
{
uint32_t lr_lreg[8]; /* %l0 through %l7 */
uint32_t lr_reg[6]; /* %o0 through %o5 */
uint32_t lr_sp; /* %o6 */
uint32_t lr_ra; /* %o7 */
uint32_t lr_struct; /* Pass-by-reference struct pointer */
} La_sparc32_regs;

typedef struct La_sparc32_retval
{
uint32_t lrv_reg[2]; /* %o0 and %o1 */
double lrv_fpreg[2]; /* %f0 and %f2 */
} La_sparc32_retval;

#else

typedef struct La_sparc64_regs
{
uint64_t lr_lreg[8]; /* %l0 through %l7 */
uint64_t lr_reg[6]; /* %o0 through %o5 */
uint64_t lr_sp; /* %o6 */
uint64_t lr_ra; /* %o7 */
double lr_fpreg[16]; /* %f0 through %f30 */
} La_sparc64_regs;

typedef struct La_sparc64_retval
{
uint64_t lrv_reg[4]; /* %o0 through %o3 */
double lrv_fprev[4]; /* %f0 through %f8 */
} La_sparc64_retval;

#endif

__BEGIN_DECLS

#if __WORDSIZE == 32

extern Elf32_Addr la_sparc32_gnu_pltenter (Elf32_Sym *__sym,
unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
La_sparc32_regs *__regs,
unsigned int *__flags,
const char *__symname,
long int *__framesizep);
extern unsigned int la_sparc32_gnu_pltexit (Elf32_Sym *__sym,
unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
const La_sparc32_regs *__inregs,
La_sparc32_retval *__outregs,
const char *symname);

#else

extern Elf64_Addr la_sparc64_gnu_pltenter (Elf64_Sym *__sym,
unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
La_sparc64_regs *__regs,
unsigned int *__flags,
const char *__symname,
long int *__framesizep);
extern unsigned int la_sparc64_gnu_pltexit (Elf64_Sym *__sym,
unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
const La_sparc64_regs *__inregs,
La_sparc64_retval *__outregs,
const char *symname);

#endif

__END_DECLS
Loading

0 comments on commit 404a4e2

Please sign in to comment.