1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00
2008-04-09  Ulrich Drepper  <drepper@redhat.com>
	* stdlib/tst-makecontext.c: Change parameter to cf to negative
	value to check for correct sign extension.

	[BZ #5436]
	* sysdeps/unix/sysv/linux/x86_64/makecontext.c (__makecontext):
	Copy 64-bit parameter values even though this is not required in
	the standard.

	* sysdeps/unix/sysv/linux/x86_64/vfork.S (__vfork): Record return
	PC save.
This commit is contained in:
Ulrich Drepper
2008-04-09 18:30:12 +00:00
parent de1bbf683e
commit 6c30d38fdd
7 changed files with 60 additions and 35 deletions

View File

@ -1,3 +1,16 @@
2008-04-09 Ulrich Drepper <drepper@redhat.com>
* stdlib/tst-makecontext.c: Change parameter to cf to negative
value to check for correct sign extension.
[BZ #5436]
* sysdeps/unix/sysv/linux/x86_64/makecontext.c (__makecontext):
Copy 64-bit parameter values even though this is not required in
the standard.
* sysdeps/unix/sysv/linux/x86_64/vfork.S (__vfork): Record return
PC save.
2008-02-14 Daniel Jacobowitz <dan@codesourcery.com> 2008-02-14 Daniel Jacobowitz <dan@codesourcery.com>
* sysdeps/unix/sysv/linux/i386/vfork.S (__vfork): Record return * sysdeps/unix/sysv/linux/i386/vfork.S (__vfork): Record return

View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Test nl_langinfo. # Test nl_langinfo.
# Copyright (C) 2000, 2001, 2003, 2007 Free Software Foundation, Inc. # Copyright (C) 2000, 2001, 2003, 2007, 2008 Free Software Foundation, Inc.
# This file is part of the GNU C Library. # This file is part of the GNU C Library.
# #
@ -245,13 +245,13 @@ de_DE.UTF-8 RADIXCHAR ,
de_DE.UTF-8 THOUSEP . de_DE.UTF-8 THOUSEP .
de_DE.UTF-8 YESEXPR ^[jJyY].* de_DE.UTF-8 YESEXPR ^[jJyY].*
de_DE.UTF-8 NOEXPR ^[nN].* de_DE.UTF-8 NOEXPR ^[nN].*
fr_FR.ISO-8859-1 ABDAY_1 dim fr_FR.ISO-8859-1 ABDAY_1 dim.
fr_FR.ISO-8859-1 ABDAY_2 lun fr_FR.ISO-8859-1 ABDAY_2 lun.
fr_FR.ISO-8859-1 ABDAY_3 mar fr_FR.ISO-8859-1 ABDAY_3 mar.
fr_FR.ISO-8859-1 ABDAY_4 mer fr_FR.ISO-8859-1 ABDAY_4 mer.
fr_FR.ISO-8859-1 ABDAY_5 jeu fr_FR.ISO-8859-1 ABDAY_5 jeu.
fr_FR.ISO-8859-1 ABDAY_6 ven fr_FR.ISO-8859-1 ABDAY_6 ven.
fr_FR.ISO-8859-1 ABDAY_7 sam fr_FR.ISO-8859-1 ABDAY_7 sam.
fr_FR.ISO-8859-1 DAY_1 dimanche fr_FR.ISO-8859-1 DAY_1 dimanche
fr_FR.ISO-8859-1 DAY_2 lundi fr_FR.ISO-8859-1 DAY_2 lundi
fr_FR.ISO-8859-1 DAY_3 mardi fr_FR.ISO-8859-1 DAY_3 mardi
@ -259,18 +259,18 @@ fr_FR.ISO-8859-1 DAY_4 mercredi
fr_FR.ISO-8859-1 DAY_5 jeudi fr_FR.ISO-8859-1 DAY_5 jeudi
fr_FR.ISO-8859-1 DAY_6 vendredi fr_FR.ISO-8859-1 DAY_6 vendredi
fr_FR.ISO-8859-1 DAY_7 samedi fr_FR.ISO-8859-1 DAY_7 samedi
fr_FR.ISO-8859-1 ABMON_1 jan fr_FR.ISO-8859-1 ABMON_1 janv.
fr_FR.ISO-8859-1 ABMON_2 f<>v fr_FR.ISO-8859-1 ABMON_2 f<>vr.
fr_FR.ISO-8859-1 ABMON_3 mar fr_FR.ISO-8859-1 ABMON_3 mars
fr_FR.ISO-8859-1 ABMON_4 avr fr_FR.ISO-8859-1 ABMON_4 avril
fr_FR.ISO-8859-1 ABMON_5 mai fr_FR.ISO-8859-1 ABMON_5 mai
fr_FR.ISO-8859-1 ABMON_6 jun fr_FR.ISO-8859-1 ABMON_6 juin
fr_FR.ISO-8859-1 ABMON_7 jui fr_FR.ISO-8859-1 ABMON_7 juil.
fr_FR.ISO-8859-1 ABMON_8 ao<61> fr_FR.ISO-8859-1 ABMON_8 ao<61>t
fr_FR.ISO-8859-1 ABMON_9 sep fr_FR.ISO-8859-1 ABMON_9 sept.
fr_FR.ISO-8859-1 ABMON_10 oct fr_FR.ISO-8859-1 ABMON_10 oct.
fr_FR.ISO-8859-1 ABMON_11 nov fr_FR.ISO-8859-1 ABMON_11 nov.
fr_FR.ISO-8859-1 ABMON_12 d<>c fr_FR.ISO-8859-1 ABMON_12 d<>c.
fr_FR.ISO-8859-1 MON_1 janvier fr_FR.ISO-8859-1 MON_1 janvier
fr_FR.ISO-8859-1 MON_2 f<>vrier fr_FR.ISO-8859-1 MON_2 f<>vrier
fr_FR.ISO-8859-1 MON_3 mars fr_FR.ISO-8859-1 MON_3 mars
@ -284,7 +284,7 @@ fr_FR.ISO-8859-1 MON_10 octobre
fr_FR.ISO-8859-1 MON_11 novembre fr_FR.ISO-8859-1 MON_11 novembre
fr_FR.ISO-8859-1 MON_12 d<>cembre fr_FR.ISO-8859-1 MON_12 d<>cembre
fr_FR.ISO-8859-1 D_T_FMT "%a %d %b %Y %T %Z" fr_FR.ISO-8859-1 D_T_FMT "%a %d %b %Y %T %Z"
fr_FR.ISO-8859-1 D_FMT "%d.%m.%Y" fr_FR.ISO-8859-1 D_FMT "%d/%m/%Y"
fr_FR.ISO-8859-1 T_FMT "%T" fr_FR.ISO-8859-1 T_FMT "%T"
fr_FR.ISO-8859-1 RADIXCHAR , fr_FR.ISO-8859-1 RADIXCHAR ,
fr_FR.ISO-8859-1 THOUSEP " " fr_FR.ISO-8859-1 THOUSEP " "

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. /* Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -598,11 +598,13 @@ compat_symbol (libpthread, __pthread_create_2_0, pthread_create,
/* If pthread_create is present, libgcc_eh.a and libsupc++.a expects some other POSIX thread /* If pthread_create is present, libgcc_eh.a and libsupc++.a expects some other POSIX thread
functions to be present as well. */ functions to be present as well. */
PTHREAD_STATIC_FN_REQUIRE (pthread_mutex_lock) PTHREAD_STATIC_FN_REQUIRE (pthread_mutex_lock)
PTHREAD_STATIC_FN_REQUIRE (pthread_mutex_trylock)
PTHREAD_STATIC_FN_REQUIRE (pthread_mutex_unlock) PTHREAD_STATIC_FN_REQUIRE (pthread_mutex_unlock)
PTHREAD_STATIC_FN_REQUIRE (pthread_once) PTHREAD_STATIC_FN_REQUIRE (pthread_once)
PTHREAD_STATIC_FN_REQUIRE (pthread_cancel) PTHREAD_STATIC_FN_REQUIRE (pthread_cancel)
PTHREAD_STATIC_FN_REQUIRE (pthread_key_create) PTHREAD_STATIC_FN_REQUIRE (pthread_key_create)
PTHREAD_STATIC_FN_REQUIRE (pthread_key_delete)
PTHREAD_STATIC_FN_REQUIRE (pthread_setspecific) PTHREAD_STATIC_FN_REQUIRE (pthread_setspecific)
PTHREAD_STATIC_FN_REQUIRE (pthread_getspecific) PTHREAD_STATIC_FN_REQUIRE (pthread_getspecific)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2006, 2007 Free Software Foundation, Inc. /* Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -28,7 +28,7 @@ __thread int thr;
void void
cf (int i) cf (int i)
{ {
if (i != 78 || thr != 94) if (i != -78 || thr != 94)
{ {
printf ("i %d thr %d\n", i, thr); printf ("i %d thr %d\n", i, thr);
exit (1); exit (1);
@ -54,7 +54,7 @@ do_test (void)
ucp.uc_link = NULL; ucp.uc_link = NULL;
ucp.uc_stack.ss_sp = st1; ucp.uc_stack.ss_sp = st1;
ucp.uc_stack.ss_size = sizeof st1; ucp.uc_stack.ss_size = sizeof st1;
makecontext (&ucp, (void (*) (void)) cf, 1, 78); makecontext (&ucp, (void (*) (void)) cf, 1, -78);
if (setcontext (&ucp) != 0) if (setcontext (&ucp) != 0)
{ {
puts ("setcontext failed"); puts ("setcontext failed");

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1999, 2002, 2004, 2005 Free Software Foundation, Inc. /* Copyright (C) 1999, 2002, 2004, 2005, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@gnu.org>. Contributed by Andreas Schwab <schwab@gnu.org>.
@ -34,6 +34,7 @@ ENTRY (__vfork)
/* Pop the return PC value into ECX. */ /* Pop the return PC value into ECX. */
popl %ecx popl %ecx
cfi_adjust_cfa_offset (-4) cfi_adjust_cfa_offset (-4)
cfi_register (%eip, %ecx)
#ifdef SAVE_PID #ifdef SAVE_PID
SAVE_PID SAVE_PID

View File

@ -1,5 +1,5 @@
/* Create new context. /* Create new context.
Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. Copyright (C) 2002, 2004, 2005, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002. Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@ -78,31 +78,39 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
sp[idx_uc_link] = (unsigned long int) ucp->uc_link; sp[idx_uc_link] = (unsigned long int) ucp->uc_link;
va_start (ap, argc); va_start (ap, argc);
/* Handle arguments. */ /* Handle arguments.
The standard says the parameters must all be int values. This is
an historic accident and would be done differently today. For
x86-64 all integer values are passed as 64-bit values and
therefore extending the API to copy 64-bit values instead of
32-bit ints makes sense. It does not break existing
functionality and it does not violate the standard which says
that passing non-int values means undefined behavior. */
for (i = 0; i < argc; ++i) for (i = 0; i < argc; ++i)
switch (i) switch (i)
{ {
case 0: case 0:
ucp->uc_mcontext.gregs [REG_RDI] = va_arg (ap, int); ucp->uc_mcontext.gregs[REG_RDI] = va_arg (ap, long int);
break; break;
case 1: case 1:
ucp->uc_mcontext.gregs [REG_RSI] = va_arg (ap, int); ucp->uc_mcontext.gregs[REG_RSI] = va_arg (ap, long int);
break; break;
case 2: case 2:
ucp->uc_mcontext.gregs [REG_RDX] = va_arg (ap, int); ucp->uc_mcontext.gregs[REG_RDX] = va_arg (ap, long int);
break; break;
case 3: case 3:
ucp->uc_mcontext.gregs [REG_RCX] = va_arg (ap, int); ucp->uc_mcontext.gregs[REG_RCX] = va_arg (ap, long int);
break; break;
case 4: case 4:
ucp->uc_mcontext.gregs [REG_R8] = va_arg (ap, int); ucp->uc_mcontext.gregs[REG_R8] = va_arg (ap, long int);
break; break;
case 5: case 5:
ucp->uc_mcontext.gregs [REG_R9] = va_arg (ap, int); ucp->uc_mcontext.gregs[REG_R9] = va_arg (ap, long int);
break; break;
default: default:
/* Put value on stack. */ /* Put value on stack. */
sp[(i - 5)] = va_arg (ap, int); sp[i - 5] = va_arg (ap, unsigned long int);
break; break;
} }
va_end (ap); va_end (ap);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. /* Copyright (C) 2001, 2002, 2004, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -31,6 +31,7 @@ ENTRY (__vfork)
is preserved by the syscall and that we're allowed to destroy. */ is preserved by the syscall and that we're allowed to destroy. */
popq %rdi popq %rdi
cfi_adjust_cfa_offset(-8) cfi_adjust_cfa_offset(-8)
cfi_register(%rip, %rdi)
#ifdef SAVE_PID #ifdef SAVE_PID
SAVE_PID SAVE_PID