summaryrefslogtreecommitdiff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-02-09 07:10:19 +0000
committerUlrich Drepper <drepper@redhat.com>2004-02-09 07:10:19 +0000
commita481b13cc296a354f9349ed41839881bbcbdf9cc (patch)
tree56e7c76acaf53218bba410b4ffe61a8100d89611 /elf/dl-load.c
parent14a60f044087f2fccf7c7d8fe4ab88f8ff3543e2 (diff)
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-load.c')
-rw-r--r--elf/dl-load.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index a3b8532955..8b9e508571 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -764,26 +764,14 @@ _dl_init_paths (const char *llp)
}
-/* Think twice before changing anything in this function. It is placed
- here and prepared using the `alloca' magic to prevent it from being
- inlined. The function is only called in case of an error. But then
- performance does not count. The function used to be "inlinable" and
- the compiled did so all the time. This increased the code size for
- absolutely no good reason. */
static void
-__attribute__ ((noreturn))
+__attribute__ ((noreturn, noinline))
lose (int code, int fd, const char *name, char *realname, struct link_map *l,
const char *msg)
{
- /* The use of `alloca' here looks ridiculous but it helps. The goal
- is to avoid the function from being inlined. There is no official
- way to do this so we use this trick. gcc never inlines functions
- which use `alloca'. */
- int *a = (int *) alloca (sizeof (int));
- a[0] = fd;
/* The file might already be closed. */
- if (a[0] != -1)
- (void) __close (a[0]);
+ if (fd != -1)
+ (void) __close (fd);
if (l != NULL)
{
/* Remove the stillborn object from the list and free it. */