Skip to content

Commit

Permalink
[BZ #783]
Browse files Browse the repository at this point in the history
2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>
	[BZ #783]
	* elf/tst-auditmod1.c: Add MIPS support.
	* sysdeps/generic/ldsodefs.h (La_mips_32_regs): New.
	(La_mips_32_retval): New.
	(La_mips_64_regs): New.
	(La_mips_64_retval): New.
	(struct audit_ifaces): Add MIPS entries.
	* sysdeps/mips/dl-machine.h: Check RESOLVE_MAP instead of RESOLVE.
	(elf_machine_runtime_link_map, ELF_DL_FRAME_SIZE,
	ELF_DL_SAVE_ARG_REGS, ELF_DL_RESTORE_ARG_REGS,
	ELF_MACHINE_RUNTIME_TRAMPOLINE): Move to dl-trampoline.c.
	(RTLD_START): Align the stack before calling _dl_init_internal.
	Use .ent for _dl_start_user.
	(ARCH_LA_PLTENTER, ARCH_LA_PLTEXIT): Define.
	(elf_machine_rel, elf_machine_rel_relative, elf_machine_lazy_rel)
	(elf_machine_runtime_setup): Use "auto inline".
	(elf_machine_rela, elf_machine_rela_relative): Provide empty versions.
	(elf_machine_got_rel): Likewise.  Use RESOLVE_MAP.
	* sysdeps/mips/dl-trampoline.c: New file.
	* sysdeps/mips/bits/link.h: New file.
	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
	(internal_syscall5): Use register operands instead of non-lvalue
	memory operands.
	(internal_syscall6): Likewise.
	(internal_syscall7): Likewise.
2005-03-28  Daniel Jacobowitz  <dan@codesourcery.com>

	[BZ #783]
	* elf/tst-auditmod1.c: Add MIPS support.
	* sysdeps/generic/ldsodefs.h (La_mips_32_regs): New.
	(La_mips_32_retval): New.
	(La_mips_64_regs): New.
	(La_mips_64_retval): New.
	(struct audit_ifaces): Add MIPS entries.
	* sysdeps/mips/dl-machine.h: Check RESOLVE_MAP instead of RESOLVE.
	(elf_machine_runtime_link_map, ELF_DL_FRAME_SIZE,
	ELF_DL_SAVE_ARG_REGS, ELF_DL_RESTORE_ARG_REGS,
	ELF_MACHINE_RUNTIME_TRAMPOLINE): Move to dl-trampoline.c.
	(RTLD_START): Align the stack before calling _dl_init_internal.
	Use .ent for _dl_start_user.
	(ARCH_LA_PLTENTER, ARCH_LA_PLTEXIT): Define.
	(elf_machine_rel, elf_machine_rel_relative, elf_machine_lazy_rel)
	(elf_machine_runtime_setup): Use "auto inline".
	(elf_machine_rela, elf_machine_rela_relative): Provide empty versions.
	(elf_machine_got_rel): Likewise.  Use RESOLVE_MAP.
	* sysdeps/mips/dl-trampoline.c: New file.
	* sysdeps/mips/bits/link.h: New file.
	* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
	(internal_syscall5): Use register operands instead of non-lvalue
	memory operands.
	(internal_syscall6): Likewise.
	(internal_syscall7): Likewise.
  • Loading branch information
ajaeger committed Mar 28, 2005
1 parent 12403b3 commit abc85e9
Show file tree
Hide file tree
Showing 7 changed files with 534 additions and 279 deletions.
28 changes: 28 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
2005-03-28 Daniel Jacobowitz <dan@codesourcery.com>

[BZ #783]
* elf/tst-auditmod1.c: Add MIPS support.
* sysdeps/generic/ldsodefs.h (La_mips_32_regs): New.
(La_mips_32_retval): New.
(La_mips_64_regs): New.
(La_mips_64_retval): New.
(struct audit_ifaces): Add MIPS entries.
* sysdeps/mips/dl-machine.h: Check RESOLVE_MAP instead of RESOLVE.
(elf_machine_runtime_link_map, ELF_DL_FRAME_SIZE,
ELF_DL_SAVE_ARG_REGS, ELF_DL_RESTORE_ARG_REGS,
ELF_MACHINE_RUNTIME_TRAMPOLINE): Move to dl-trampoline.c.
(RTLD_START): Align the stack before calling _dl_init_internal.
Use .ent for _dl_start_user.
(ARCH_LA_PLTENTER, ARCH_LA_PLTEXIT): Define.
(elf_machine_rel, elf_machine_rel_relative, elf_machine_lazy_rel)
(elf_machine_runtime_setup): Use "auto inline".
(elf_machine_rela, elf_machine_rela_relative): Provide empty versions.
(elf_machine_got_rel): Likewise. Use RESOLVE_MAP.
* sysdeps/mips/dl-trampoline.c: New file.
* sysdeps/mips/bits/link.h: New file.
* sysdeps/unix/sysv/linux/mips/mips32/sysdep.h
(internal_syscall5): Use register operands instead of non-lvalue
memory operands.
(internal_syscall6): Likewise.
(internal_syscall7): Likewise.

2005-03-27 Andreas Jaeger <aj@suse.de>

* debug/warning-nop.c (__builtin___memcpy_chk): Define away to
Expand Down
18 changes: 18 additions & 0 deletions elf/tst-auditmod1.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,24 @@ la_symbind64 (Elf64_Sym *sym, unsigned int ndx, uintptr_t *refcook,
# define La_regs La_ia64_regs
# define La_retval La_ia64_retval
# define int_retval lrv_r8
#elif defined __mips__ && _MIPS_SIM == _ABIO32
# define pltenter la_mips_o32_gnu_pltenter
# define pltexit la_mips_o32_gnu_pltexit
# define La_regs La_mips_32_regs
# define La_retval La_mips_32_retval
# define int_retval lrv_v0
#elif defined __mips__ && _MIPS_SIM == _ABIN32
# define pltenter la_mips_n32_gnu_pltenter
# define pltexit la_mips_n32_gnu_pltexit
# define La_regs La_mips_64_regs
# define La_retval La_mips_64_retval
# define int_retval lrv_v0
#elif defined __mips__ && _MIPS_SIM == _ABI64
# define pltenter la_mips_n64_gnu_pltenter
# define pltexit la_mips_n64_gnu_pltexit
# define La_regs La_mips_64_regs
# define La_retval La_mips_64_retval
# define int_retval lrv_v0
#else
# error "architecture specific code needed"
#endif
Expand Down
34 changes: 34 additions & 0 deletions sysdeps/generic/ldsodefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ struct La_s390_64_regs;
struct La_s390_64_retval;
struct La_ia64_regs;
struct La_ia64_retval;
struct La_mips_32_regs;
struct La_mips_32_retval;
struct La_mips_64_regs;
struct La_mips_64_retval;

struct audit_ifaces
{
Expand Down Expand Up @@ -251,6 +255,21 @@ struct audit_ifaces
uintptr_t *, struct La_ia64_regs *,
unsigned int *, const char *name,
long int *framesizep);
Elf32_Addr (*mips_o32_gnu_pltenter) (Elf32_Sym *, unsigned int,
uintptr_t *, uintptr_t *,
const struct La_mips_32_regs *,
unsigned int *, const char *name,
long int *framesizep);
Elf32_Addr (*mips_n32_gnu_pltenter) (Elf32_Sym *, unsigned int,
uintptr_t *, uintptr_t *,
const struct La_mips_64_regs *,
unsigned int *, const char *name,
long int *framesizep);
Elf64_Addr (*mips_n64_gnu_pltenter) (Elf64_Sym *, unsigned int,
uintptr_t *, uintptr_t *,
const struct La_mips_64_regs *,
unsigned int *, const char *name,
long int *framesizep);
};
union
{
Expand Down Expand Up @@ -294,6 +313,21 @@ struct audit_ifaces
uintptr_t *,
const struct La_ia64_regs *,
struct La_ia64_retval *, const char *);
unsigned int (*mips_o32_gnu_pltexit) (Elf32_Sym *, unsigned int,
uintptr_t *, uintptr_t *,
const struct La_mips_32_regs *,
struct La_mips_32_retval *,
const char *);
unsigned int (*mips_n32_gnu_pltexit) (Elf32_Sym *, unsigned int,
uintptr_t *, uintptr_t *,
const struct La_mips_64_regs *,
struct La_mips_64_retval *,
const char *);
unsigned int (*mips_n64_gnu_pltexit) (Elf64_Sym *, unsigned int,
uintptr_t *, uintptr_t *,
const struct La_mips_64_regs *,
struct La_mips_64_retval *,
const char *);
};
unsigned int (*objclose) (uintptr_t *);

Expand Down
118 changes: 118 additions & 0 deletions sysdeps/mips/bits/link.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/* 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

#include <sgidefs.h>

#if _MIPS_SIM == _ABIO32

/* Registers for entry into PLT on MIPS. */
typedef struct La_mips_32_regs
{
uint32_t lr_reg[4]; /* $a0 through $a3 */
double lr_fpreg[2]; /* $f12 and $f14 */
uint32_t lr_ra;
uint32_t lr_sp;
} La_mips_32_regs;

/* Return values for calls from PLT on MIPS. */
typedef struct La_mips_32_retval
{
uint32_t lrv_v0;
uint32_t lrv_v1;
double lrv_f0;
double lrv_f2;
} La_mips_32_retval;

#else

typedef struct La_mips_64_regs
{
uint64_t lr_reg[8]; /* $a0 through $a7 */
double lr_fpreg[8]; /* $f12 throgh $f19 */
uint64_t lr_ra;
uint64_t lr_sp;
} La_mips_64_regs;

/* Return values for calls from PLT on MIPS. */
typedef struct La_mips_64_retval
{
uint64_t lrv_v0;
uint64_t lrv_v1;
double lrv_f0;
double lrv_f2;
} La_mips_64_retval;

#endif

__BEGIN_DECLS

#if _MIPS_SIM == _ABIO32

extern Elf32_Addr la_mips_o32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
La_mips_32_regs *__regs,
unsigned int *__flags,
const char *__symname,
long int *__framesizep);
extern unsigned int la_mips_o32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
const La_mips_32_regs *__inregs,
La_mips_32_retval *__outregs,
const char *symname);

#elif _MIPS_SIM == _ABIN32

extern Elf32_Addr la_mips_n32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
La_mips_64_regs *__regs,
unsigned int *__flags,
const char *__symname,
long int *__framesizep);
extern unsigned int la_mips_n32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
const La_mips_64_regs *__inregs,
La_mips_64_retval *__outregs,
const char *symname);

#else

extern Elf64_Addr la_mips_n64_gnu_pltenter (Elf64_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
La_mips_64_regs *__regs,
unsigned int *__flags,
const char *__symname,
long int *__framesizep);
extern unsigned int la_mips_n64_gnu_pltexit (Elf64_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
const La_mips_64_regs *__inregs,
La_mips_64_retval *__outregs,
const char *symname);

#endif

__END_DECLS
Loading

0 comments on commit abc85e9

Please sign in to comment.