History log of /freebsd-10-stable/lib/libc/i386/sys/getcontext.S
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 240152 05-Sep-2012 jilles

libc/i386: Do not export .cerror.

For some reason, libc exports the symbol .cerror (HIDENAME(cerror)), albeit
in the FBSDprivate_1.0 version. It looks like there is no reason for this
since it is not used from other libraries. Given that it cannot be accessed
from C and its strange calling convention, it is rather unlikely that other
things rely on it. Perhaps it is from a time when symbols could not be
hidden.

Not exporting .cerror causes it to be jumped to directly instead of via the
PLT.

This change also takes advantage of .cerror's new status by not saving and
loading %ebx before jumping to it. (Therefore, .cerror now saves and loads
%ebx itself.) Where there was a conditional jump to a jump to .cerror, the
conditional jump has been changed to jump to .cerror directly (many modern
CPUs don't do static prediction and in any case it is not much of a benefit
anyway).

This change makes libc.so.7 a few kilobytes smaller.

Reviewed by: kib


# 217106 07-Jan-2011 kib

Add section .note.GNU-stack for assembly files used by 386 and amd64.


# 184548 02-Nov-2008 peter

Add missing END() macros, as per rev 184547 for amd64. The lack of these
is mostly harmless, but it does upset some of valgrind's functionality.


# 119724 03-Sep-2003 peter

Make getcontext(2) work on i386. It needs a small wrapper in libc
otherwise the return from the syscall stub for getcontext will pop off
the return value for the caller to the getcontext stub and it will appear
as though the setcontext() syscall returned instead of the getcontext().
The same bug exists on amd64, a fix is coming there too.

The bug can be demonstrated with this test code fragment:
main()
{
ucontext_t top;

if (getcontext(&top) == 0) {
write(2, "PING!\n", 6);
/* Cause a return value of 1 from getcontext this time */
top.uc_mcontext.mc_eax = 1;
setcontext(&top);
err(1, "setcontext() returned");
}
write(2, "PONG!\n", 6);
_exit(0);
}