mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
* elf/dl-runtime.c (IN_DL_RUNTIME): Define this macro first thing.
* sysdeps/i386/dl-machine.h: Only declare fixup, profile_fixup and define ELF_MACHINE_RUNTIME_TRAMPOLINE under #ifdef IN_DL_RUNTIME.
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
2002-08-29 Roland McGrath <roland@redhat.com>
|
2002-08-29 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
|
* elf/dl-runtime.c (IN_DL_RUNTIME): Define this macro first thing.
|
||||||
|
* sysdeps/i386/dl-machine.h: Only declare fixup, profile_fixup and
|
||||||
|
define ELF_MACHINE_RUNTIME_TRAMPOLINE under #ifdef IN_DL_RUNTIME.
|
||||||
|
|
||||||
* sysdeps/generic/readelflib.c (process_elf_file): Fix typo.
|
* sysdeps/generic/readelflib.c (process_elf_file): Fix typo.
|
||||||
|
|
||||||
* iconv/gconv_int.h: Include <stdlib.h> for alloca decl.
|
* iconv/gconv_int.h: Include <stdlib.h> for alloca decl.
|
||||||
|
@@ -17,6 +17,8 @@
|
|||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
|
#define IN_DL_RUNTIME 1 /* This can be tested in dl-machine.h. */
|
||||||
|
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@@ -92,22 +92,6 @@ elf_machine_load_address (void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !defined PROF && !__BOUNDED_POINTERS__
|
|
||||||
/* We add a declaration of this function here so that in dl-runtime.c
|
|
||||||
the ELF_MACHINE_RUNTIME_TRAMPOLINE macro really can pass the parameters
|
|
||||||
in registers.
|
|
||||||
|
|
||||||
We cannot use this scheme for profiling because the _mcount call
|
|
||||||
destroys the passed register information. */
|
|
||||||
/* GKM FIXME: Fix trampoline to pass bounds so we can do
|
|
||||||
without the `__unbounded' qualifier. */
|
|
||||||
static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset)
|
|
||||||
__attribute__ ((regparm (2), unused));
|
|
||||||
static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
|
|
||||||
ElfW(Addr) retaddr)
|
|
||||||
__attribute__ ((regparm (3), unused));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set up the loaded object described by L so its unrelocated PLT
|
/* Set up the loaded object described by L so its unrelocated PLT
|
||||||
entries will jump to the on-demand fixup code in dl-runtime.c. */
|
entries will jump to the on-demand fixup code in dl-runtime.c. */
|
||||||
|
|
||||||
@@ -159,10 +143,28 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
|||||||
return lazy;
|
return lazy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef IN_DL_RUNTIME
|
||||||
|
|
||||||
|
# if !defined PROF && !__BOUNDED_POINTERS__
|
||||||
|
/* We add a declaration of this function here so that in dl-runtime.c
|
||||||
|
the ELF_MACHINE_RUNTIME_TRAMPOLINE macro really can pass the parameters
|
||||||
|
in registers.
|
||||||
|
|
||||||
|
We cannot use this scheme for profiling because the _mcount call
|
||||||
|
destroys the passed register information. */
|
||||||
|
/* GKM FIXME: Fix trampoline to pass bounds so we can do
|
||||||
|
without the `__unbounded' qualifier. */
|
||||||
|
static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset)
|
||||||
|
__attribute__ ((regparm (2), unused));
|
||||||
|
static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
|
||||||
|
ElfW(Addr) retaddr)
|
||||||
|
__attribute__ ((regparm (3), unused));
|
||||||
|
# endif
|
||||||
|
|
||||||
/* This code is used in dl-runtime.c to call the `fixup' function
|
/* This code is used in dl-runtime.c to call the `fixup' function
|
||||||
and then redirect to the address it returns. */
|
and then redirect to the address it returns. */
|
||||||
#if !defined PROF && !__BOUNDED_POINTERS__
|
# if !defined PROF && !__BOUNDED_POINTERS__
|
||||||
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
|
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
|
||||||
.text\n\
|
.text\n\
|
||||||
.globl _dl_runtime_resolve\n\
|
.globl _dl_runtime_resolve\n\
|
||||||
.type _dl_runtime_resolve, @function\n\
|
.type _dl_runtime_resolve, @function\n\
|
||||||
@@ -198,7 +200,7 @@ _dl_runtime_profile:\n\
|
|||||||
.size _dl_runtime_profile, .-_dl_runtime_profile\n\
|
.size _dl_runtime_profile, .-_dl_runtime_profile\n\
|
||||||
.previous\n\
|
.previous\n\
|
||||||
");
|
");
|
||||||
#else
|
# else
|
||||||
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\
|
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\
|
||||||
.text\n\
|
.text\n\
|
||||||
.globl _dl_runtime_resolve\n\
|
.globl _dl_runtime_resolve\n\
|
||||||
@@ -226,6 +228,7 @@ _dl_runtime_profile:\n\
|
|||||||
.size _dl_runtime_profile, .-_dl_runtime_profile\n\
|
.size _dl_runtime_profile, .-_dl_runtime_profile\n\
|
||||||
.previous\n\
|
.previous\n\
|
||||||
");
|
");
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Mask identifying addresses reserved for the user program,
|
/* Mask identifying addresses reserved for the user program,
|
||||||
|
Reference in New Issue
Block a user