diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-02-09 07:10:19 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-02-09 07:10:19 +0000 |
commit | a481b13cc296a354f9349ed41839881bbcbdf9cc (patch) | |
tree | 56e7c76acaf53218bba410b4ffe61a8100d89611 /elf/dl-runtime.c | |
parent | 14a60f044087f2fccf7c7d8fe4ab88f8ff3543e2 (diff) | |
download | glibc-a481b13cc296a354f9349ed41839881bbcbdf9cc.tar.gz glibc-a481b13cc296a354f9349ed41839881bbcbdf9cc.tar.xz glibc-a481b13cc296a354f9349ed41839881bbcbdf9cc.zip |
Update.
* elf/dl-load.c (lose): Use noinline attribute instead of silly alloca to prevent inlining. * elf/dl-runtime.c (fixup): Likewise. (profile_fixup): Likewise.
Diffstat (limited to 'elf/dl-runtime.c')
-rw-r--r-- | elf/dl-runtime.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c index 58e4c6c3e6..2992f652c6 100644 --- a/elf/dl-runtime.c +++ b/elf/dl-runtime.c @@ -1,5 +1,5 @@ /* On-demand PLT fixup for shared objects. - Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1995-2002, 2003, 2004 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 @@ -45,7 +45,8 @@ function. */ #ifndef ELF_MACHINE_NO_PLT -static ElfW(Addr) __attribute_used__ +static ElfW(Addr) +__attribute ((used, noinline)) fixup ( # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS ELF_MACHINE_RUNTIME_FIXUP_ARGS, @@ -65,12 +66,6 @@ fixup ( lookup_t result; ElfW(Addr) value; - /* The use of `alloca' here looks ridiculous but it helps. The goal is - to prevent the function from being inlined and thus optimized out. - There is no official way to do this so we use this trick. gcc never - inlines functions which use `alloca'. */ - alloca (sizeof (int)); - /* Sanity check that we're really looking at a PLT relocation. */ assert (ELFW(R_TYPE)(reloc->r_info) == ELF_MACHINE_JMP_SLOT); @@ -132,7 +127,8 @@ fixup ( #if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__ -static ElfW(Addr) __attribute_used__ +static ElfW(Addr) +__attribute ((used, noinline)) profile_fixup ( #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS ELF_MACHINE_RUNTIME_FIXUP_ARGS, @@ -144,12 +140,6 @@ profile_fixup ( lookup_t result; ElfW(Addr) value; - /* The use of `alloca' here looks ridiculous but it helps. The goal is - to prevent the function from being inlined, and thus optimized out. - There is no official way to do this so we use this trick. gcc never - inlines functions which use `alloca'. */ - alloca (sizeof (int)); - /* This is the address in the array where we store the result of previous relocations. */ resultp = &l->l_reloc_result[reloc_offset / sizeof (PLTREL)]; |