PATCH: BPs for elf PLT trampoline
Greg McGary
greg@mcgary.org
Sat Jul 15 22:37:00 GMT 2000
No build regressions. No non-BP binary differences.
2000-07-15 Greg McGary <greg@mcgary.org>
* elf/dl-runtime.c (fixup): Trampoline passes unbounded pointer.
(profile_fixup): Don't define for __BOUNDED_POINTERS__.
* sysdeps/i386/dl-machine.h: Don't use regparm attribute for
__BOUNDED_POINTERS__.
(ELF_MACHINE_RUNTIME_TRAMPOLINE): Use non-regparm version
for __BOUNDED_POINTERS__.
Index: elf/dl-runtime.c
===================================================================
RCS file: /cvs/glibc/libc/elf/dl-runtime.c,v
retrieving revision 1.44
diff -u -p -r1.44 dl-runtime.c
--- dl-runtime.c 2000/06/08 04:46:06 1.44
+++ dl-runtime.c 2000/07/16 05:35:27
@@ -47,7 +47,7 @@ fixup (
# ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
ELF_MACHINE_RUNTIME_FIXUP_ARGS,
# endif
- struct link_map *l, ElfW(Word) reloc_offset)
+ struct link_map *__unbounded l, ElfW(Word) reloc_offset)
{
const ElfW(Sym) *const symtab
= (const void *) D_PTR (l, l_info[DT_SYMTAB]);
@@ -119,14 +119,14 @@ fixup (
}
#endif
-#if !defined PROF && !defined ELF_MACHINE_NO_PLT
+#if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__
static ElfW(Addr) __attribute__ ((unused))
profile_fixup (
#ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
ELF_MACHINE_RUNTIME_FIXUP_ARGS,
#endif
- struct link_map *l, ElfW(Word) reloc_offset, ElfW(Addr) retaddr)
+ struct link_map *__unbounded l, ElfW(Word) reloc_offset, ElfW(Addr) retaddr)
{
void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = _dl_mcount;
ElfW(Addr) *resultp;
Index: sysdeps/i386/dl-machine.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/i386/dl-machine.h,v
retrieving revision 1.77
diff -u -p -r1.77 dl-machine.h
--- dl-machine.h 2000/06/08 04:18:45 1.77
+++ dl-machine.h 2000/07/16 05:35:27
@@ -60,16 +60,16 @@ elf_machine_load_address (void)
return addr;
}
-#ifndef PROF
+#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. */
-static ElfW(Addr) fixup (struct link_map *l, ElfW(Word) reloc_offset)
+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,
+static ElfW(Addr) profile_fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset,
ElfW(Addr) retaddr)
__attribute__ ((regparm (3), unused));
#endif
@@ -119,7 +119,7 @@ elf_machine_runtime_setup (struct link_m
/* This code is used in dl-runtime.c to call the `fixup' function
and then redirect to the address it returns. */
-#ifndef PROF
+#if !defined PROF && !__BOUNDED_POINTERS__
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
.text
.globl _dl_runtime_resolve
More information about the Libc-hacker
mailing list