Skip to content

Commit

Permalink
Preserve stack alignment in i386 makecontext.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Jul 23, 2009
1 parent c15b1d2 commit 9b6bf8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2009-07-23 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/i386/makecontext.S: Ensure we preserve the
stack alignment in the exit code.

* elf/dl-lookup.c (dl_lookup_x): The hashval for unique symbol can
potentially be zero.

Expand Down
10 changes: 4 additions & 6 deletions sysdeps/unix/sysv/linux/i386/makecontext.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Create new context.
Copyright (C) 2001, 2002, 2005, 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2001,2002,2005,2007,2008,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
Expand Down Expand Up @@ -105,17 +105,15 @@ L(exitcode):
1: popl %ebx
addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
#endif
popl %eax /* This is the next context. */
testl %eax, %eax
cmpl $0, (%esp) /* Check the next context. */
je 2f /* If it is zero exit. */

pushl %eax
call JUMPTARGET(__setcontext)
/* If this returns (which can happen if the syscall fails) we'll
exit the program with the return error value (-1). */

2: pushl %eax
call HIDDEN_JUMPTARGET(exit)
movl %eax, (%esp)
2: call HIDDEN_JUMPTARGET(exit)
/* The 'exit' call should never return. In case it does cause
the process to terminate. */
hlt
Expand Down

0 comments on commit 9b6bf8a

Please sign in to comment.