libc: add _get_tp() private function(cherry picked from commit 06d8a116bd6b6f70b8aedc6a6a2c4085c53f63ac)
amd64 fabs(3): move signbit to .rodata(cherry picked from commit f548033818b8bbcee17ad3926103f2a9b2c975df)(cherry picked from commit 6d3f54fd090162ab14e2ec66f46bb1335a127a30)(cherry picked from c
amd64 fabs(3): move signbit to .rodata(cherry picked from commit f548033818b8bbcee17ad3926103f2a9b2c975df)(cherry picked from commit 6d3f54fd090162ab14e2ec66f46bb1335a127a30)(cherry picked from commit d218c6f6af336135ea88342d472b0e66c21239c9)
show more ...
Unify i386 and amd64 getcontextx.c, and use ifuncs while there.In particular, use ifuncs for __getcontextx_size(), also calculate thesize of the extended save area in resolver. Same for __fillcon
Unify i386 and amd64 getcontextx.c, and use ifuncs while there.In particular, use ifuncs for __getcontextx_size(), also calculate thesize of the extended save area in resolver. Same for __fillcontextx2().Sponsored by: The FreeBSD FoundationMFC after: 1 week
Remove support for SYS_sys_exit in favor of SYS_exit.SYS_exit has been defined in the repo since 1994 except for a briefwindow when SYS_sys_exit was defined in 2000.
libc: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using mis-identified many licenses so this was mostly a manual - errorp
libc: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using mis-identified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
Renumber copyright clause 4Renumber cluase 4 to 3, per what everybody else did when BSD grantedthem permission to remove clause 3. My insistance on keeping the samenumbering for legal reasons is
Renumber copyright clause 4Renumber cluase 4 to 3, per what everybody else did when BSD grantedthem permission to remove clause 3. My insistance on keeping the samenumbering for legal reasons is too pedantic, so give up on that point.Submitted by: Jan Schaumann <[email protected]>Pull Request: https://github.com/freebsd/freebsd/pull/96
Add include for declaration of _set_tp(). Eliminates -Wmissing-prototypes warnings.
Switch libc from using _sig{procmask,action,suspend} symbols, whichare aliases for the syscall stubs and are plt-interposed, to thelibc-private aliases of internally interposed sigprocmask() etc.
Switch libc from using _sig{procmask,action,suspend} symbols, whichare aliases for the syscall stubs and are plt-interposed, to thelibc-private aliases of internally interposed sigprocmask() etc.Since e.g. _sigaction is not interposed by libthr, calling signal()removes thr_sighandler() from the handler slot etc. The result wasbreaking signal semantic and rtld locking.The added __libc_sigprocmask and other symbols are hidden, they arenot exported and cannot be called through PLT. The setjmp/longjmpfunctions for x86 were changed to use direct calls, and sincePIC_PROLOGUE only needed for functional PLT indirection on i386, it isremoved as well.The PowerPC bug of calling the syscall directly in the setjmp/longjmpimplementation is kept as is.Reported by: Pete French <[email protected]>Tested by: Michiel Boland <[email protected]>Reviewed by: jilles (previous version)Sponsored by: The FreeBSD FoundationMFC after: 1 week
siglongjmp(): Preserve floating point exception flags on i386 and amd64.Per POSIX, siglongjmp() shall be equivalent to longjmp() except that it mustmatch sigsetjmp() instead of setjmp() and except
siglongjmp(): Preserve floating point exception flags on i386 and amd64.Per POSIX, siglongjmp() shall be equivalent to longjmp() except that it mustmatch sigsetjmp() instead of setjmp() and except for the effect on thesignal mask. Therefore, it should preserve the floating point exceptionflags.This was fixed for longjmp() and _longjmp() in r180080 and r180081 for amd64and i386 respectively.
Introduce a WEAK_REFERENCE() alias and use it. Get rid of the CNAME and theCONCAT macros in SYS.h.Reviewed by: bde, kib
The getcontext() from the __fillcontextx() call in thecheck_deferred_signal() returns twice, since handle_signal() emulatesthe return from the normal signal handler by sigreturn(2)ing thepassed co
The getcontext() from the __fillcontextx() call in thecheck_deferred_signal() returns twice, since handle_signal() emulatesthe return from the normal signal handler by sigreturn(2)ing thepassed context. Second return is performed on the destroyed stackframe, because __fillcontextx() has already returned. This causesundefined and bad behaviour, usually the victim thread gets SIGSEGV.Avoid nested frame and the need to return from it by doing direct callto getcontext() in the check_deferred_signal() and using a new privatelibc helper __fillcontextx2() to complement the context with theextended CPU state if the deferred signal is still present.The __fillcontextx() is now unused, but is kept to allow olderlibthr.so to be used with the new libc.Mark __fillcontextx() as returning twice [1].Reported by: pgjPointy hat to: kibDiscussed with: dimTested by: pgj, dimSuggested by: jilles [1]MFC after: 1 week
libc/amd64: Do not export .cerror.For some reason, libc exports the symbol .cerror (HIDENAME(cerror)), albeitin the FBSDprivate_1.0 version. It looks like there is no reason for thissince it is n
libc/amd64: Do not export .cerror.For some reason, libc exports the symbol .cerror (HIDENAME(cerror)), albeitin the FBSDprivate_1.0 version. It looks like there is no reason for thissince it is not used from other libraries. Given that it cannot be accessedfrom C and its strange calling convention, it is rather unlikely that otherthings rely on it. Perhaps it is from a time when symbols could not behidden.Most of the amd64 assembler code jumps to .cerror using the GOT. It can jumpto it directly now, as in non-PIC mode.There are also some minor size optimizations to instructions but they yieldvirtually no benefit in the size of libc.so.7 due to padding.Reviewed by: kib
Make the sys/ucontext.h self-contained by changing the return typeof __getcontextx_size(3) from size_t to int.PR: ports/164654MFC after: 1 month
Add API for obtaining extended machine context states that cannot befit into existing mcontext_t.On i386 and amd64 do return the extended FPU states usinggetcontextx(3). For other architectures,
Add API for obtaining extended machine context states that cannot befit into existing mcontext_t.On i386 and amd64 do return the extended FPU states usinggetcontextx(3). For other architectures, getcontextx(3) returns thesame information as getcontext(2).Tested by: phoMFC after: 1 month
Make sure that stack is 16-byte aligned before calling a function,as it is required by amd64 ABI. Add a comment for the places werethe stack is accidentally properly aligned already.PR: amd64/162
Make sure that stack is 16-byte aligned before calling a function,as it is required by amd64 ABI. Add a comment for the places werethe stack is accidentally properly aligned already.PR: amd64/162214Submitted by: yamayan <yamayan kbh biglobe ne jp>MFC after: 1 week
Replace a proliferation of buggy MD implementations of modf() with aworking MI one. The MI one only needs to be overridden on machineswith non-IEEE754 arithmetic. (The last supported one was the
Replace a proliferation of buggy MD implementations of modf() with aworking MI one. The MI one only needs to be overridden on machineswith non-IEEE754 arithmetic. (The last supported one was the VAX.)It can also be overridden if someone comes up with a faster one thatactually passes the regression tests -- but this is harder than it sounds.
Add section .note.GNU-stack for assembly files used by 386 and amd64.
Retire the amd64 and i386 specific inline assembly versions of ldexp.c,as they are slower than the generic version in C, at least on modernhardware. This leaves us with just five implementations.
Retire the amd64 and i386 specific inline assembly versions of ldexp.c,as they are slower than the generic version in C, at least on modernhardware. This leaves us with just five implementations.Suggested by: bdeApproved by: rpaulo (mentor)
Apply the same workaround for clang to amd64's version of ldexp.c (as inr212976): order the incoming arguments to fscale as st(0), st(1), andmark temp2 volatile (only in case of compilation with cl
Apply the same workaround for clang to amd64's version of ldexp.c (as inr212976): order the incoming arguments to fscale as st(0), st(1), andmark temp2 volatile (only in case of compilation with clang) to forceclang to pop it correctly. No binary change when compiled with gcc.This fixes ldexp() when compiled with clang on amd64, which makesdrand48() and friends work correctly again, and this in turn fixesperl's tempfile().Reported by: Renato Botelho, Derek TattersallApproved by: rpaulo (mentor)
We've been lax about matching END() macros in asm code for some time. Thisis used to set the ELF size attribute for functions. It isn't normallycritical but some things can make use of it (gdb fo
We've been lax about matching END() macros in asm code for some time. Thisis used to set the ELF size attribute for functions. It isn't normallycritical but some things can make use of it (gdb for stack traces).Valgrind needs it so I'm adding it in. The problem is present on allbranches and on both i386 and amd64.
Two FP-related setjmp/longjmp changes:1. Save and restore the control part of the MXCSR in addition to the i387 control word to ensure that the two are consistent. Note that standards don't
Two FP-related setjmp/longjmp changes:1. Save and restore the control part of the MXCSR in addition to the i387 control word to ensure that the two are consistent. Note that standards don't require longjmp to restore either control word, and none of Linux, MacOS X 10.3 and earlier, NetBSD, OpenBSD, or Solaris do it. However, it is historical FreeBSD behavior, and bde points out that it is needed to make longjmping out of a signal handler work properly, given the way FreeBSD clobbers the FPU state on signal handler entry.2. Don't clobber the FPU exception flags in longjmp. C99 requires them to remain unchanged.
Remove silly n that crept in
Per Regents of the University of Calfornia letter, remove advertisingclause.# If I've done so improperly on a file, please let me know.
Remove fpsetsticky(). This was added for SysV compatibility, but dueto mistakes from day 1, it has always had semantics inconsistent withSVR4 and its successors. In particular, given argument M:
Remove fpsetsticky(). This was added for SysV compatibility, but dueto mistakes from day 1, it has always had semantics inconsistent withSVR4 and its successors. In particular, given argument M:- On Solaris and FreeBSD/{alpha,sparc64}, it clobbers the old flags and *sets* the new flag word to M. (NetBSD, too?)- On FreeBSD/{amd64,i386}, it *clears* the flags that are specified in M and leaves the remaining flags unchanged (modulo a small bug on amd64.)- On FreeBSD/ia64, it is not implemented.There is no way to fix fpsetsticky() to DTRT for both old FreeBSD appsand apps ported from other operating systems, so the best approachseems to be to kill the function and fix any apps that break. Icouldn't find any ports that use it, and any such ports would alreadybe broken on FreeBSD/ia64 and Linux anyway.By the way, the routine has always been undocumented in FreeBSD,except for an MLINK to a manpage that doesn't describe it. Thismanpage has stated since 5.3-RELEASE that the functions it describesare deprecated, so that must mean that functions that it is *supposed*to describe but doesn't are even *more* deprecated. ;-)Note that fpresetsticky() has been retained on FreeBSD/i386. As faras I can tell, no other operating systems or ports of FreeBSDimplement it, so there's nothing for it to be inconsistent with.PR: 75862Suggested by: bde
Add support for TLS in statically linked programs.
12345