From 606832e6e59fc9771c1c9b2de8666bdfb0b344de Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 8 Feb 2005 08:25:22 +0000 Subject: * sysdeps/sh/dl-machine.h (elf_machine_rela): Remove code using RESOLVE. 2005-02-07 Ulrich Drepper * elf/dl-load.c (_dl_map_object_from_fd): Makre sure registers are set correctly. * sysdeps/unix/sysv/linux/i386/sysdep.h (check_consistency): Define. --- sysdeps/unix/sysv/linux/dl-execstack.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'sysdeps/unix') diff --git a/sysdeps/unix/sysv/linux/dl-execstack.c b/sysdeps/unix/sysv/linux/dl-execstack.c index 6ef9679045..b38d0c4238 100644 --- a/sysdeps/unix/sysv/linux/dl-execstack.c +++ b/sysdeps/unix/sysv/linux/dl-execstack.c @@ -1,5 +1,5 @@ /* Stack executability handling for GNU dynamic linker. Linux version. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 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 @@ -24,6 +24,7 @@ #include #include #include +#include #include "kernel-features.h" @@ -38,6 +39,7 @@ _dl_make_stack_executable (void **stack_endp) /* This gives us the highest/lowest page that needs to be changed. */ uintptr_t page = ((uintptr_t) *stack_endp & -(intptr_t) GLRO(dl_pagesize)); + int result = 0; /* Challenge the caller. */ if (__builtin_expect (__check_caller (RETURN_ADDRESS (0), @@ -60,7 +62,10 @@ _dl_make_stack_executable (void **stack_endp) no_growsupdown = true; else # endif - return errno; + { + result = errno; + goto out; + } } #endif @@ -85,7 +90,10 @@ _dl_make_stack_executable (void **stack_endp) else { if (errno != ENOMEM) /* Unexpected failure mode. */ - return errno; + { + result = errno; + goto out; + } if (size == GLRO(dl_pagesize)) /* We just tried to mprotect the top hole page and failed. @@ -108,7 +116,10 @@ _dl_make_stack_executable (void **stack_endp) else { if (errno != ENOMEM) /* Unexpected failure mode. */ - return errno; + { + result = errno; + goto out; + } if (size == GLRO(dl_pagesize)) /* We just tried to mprotect the lowest hole page and failed. @@ -133,6 +144,11 @@ _dl_make_stack_executable (void **stack_endp) /* Remember that we changed the permission. */ GL(dl_stack_flags) |= PF_X; - return 0; + out: +#ifdef check_consistency + check_consistency (); +#endif + + return result; } rtld_hidden_def (_dl_make_stack_executable) -- cgit v1.2.3