summaryrefslogtreecommitdiff
path: root/lib/libc/i386
Commit message (Collapse)AuthorAgeFilesLines
* remove obsolete i386 MD memchr implementationEd Maste2019-09-252-62/+0
| | | | | | | | | | | | | | | bde reports (in a reply to r351700 commit mail): This uses scasb, which was last optimal on the 8086, or perhaps the original i386. On freefall, it is several times slower than the naive translation of the naive C code. Reported by: bde Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21785 Notes: svn path=/head/; revision=352689
* Fix initial exec TLS mode for dynamically loaded shared objects.Konstantin Belousov2019-03-291-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | If dso uses initial exec TLS mode, rtld tries to allocate TLS in static space. If there is no space left, the dlopen(3) fails. If space if allocated, initial content from PT_TLS segment is distributed to all threads' pcbs, which was missed and caused un-initialized TLS segment for such dso after dlopen(3). The mode is auto-detected either due to the relocation used, or if the DF_STATIC_TLS dynamic flag is set. In the later case, the TLS segment is tried to allocate earlier, which increases chance of the dlopen(3) to succeed. LLD was recently fixed to properly emit the flag, ld.bdf did it always. Initial test by: dumbbell Tested by: emaste (amd64), ian (arm) Tested by: Gerald Aryeetey <aryeeteygerald_rogers.com> (arm64) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19072 Notes: svn path=/head/; revision=345703
* Add usermode helpers for for Intel userspace protection keys feature.Konstantin Belousov2019-02-201-0/+7
| | | | | | | | | | | Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Notes: svn path=/head/; revision=344354
* Unify i386 and amd64 getcontextx.c, and use ifuncs while there.Konstantin Belousov2019-02-142-146/+1
| | | | | | | | | | | In particular, use ifuncs for __getcontextx_size(), also calculate the size of the extended save area in resolver. Same for __fillcontextx2(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=344120
* Remove MD __sys_* private symbols.Brooks Davis2018-12-051-3/+0
| | | | | | | | | | | | | No references to any of these exist in the tree. The list was also erratic with different architectures exporting different things (arm64 and riscv exported none). Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18425 Notes: svn path=/head/; revision=341509
* amd64: depessimize userspace memcpy/memmove/bcopyMateusz Guzik2018-09-171-3/+10
| | | | | | | | | | | | | The change resembles what was done in r334537 for kernel routines. While here take care of i386 variants. Note that primitives remain suboptimal. Reviewed by: kib (previous version) Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D17167 Notes: svn path=/head/; revision=338713
* Reimplement brk() and sbrk() to avoid the use of _end.Mark Johnston2018-06-044-176/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Previously, libc.so would initialize its notion of the break address using _end, a special symbol emitted by the static linker following the bss section. Compatibility issues between lld and ld.bfd could cause the wrong definition of _end (libc.so's definition rather than that of the executable) to be used, breaking the brk()/sbrk() interface. Avoid this problem and future interoperability issues by simply not relying on _end. Instead, modify the break() system call to return the kernel's view of the current break address, and have libc initialize its state using an extra syscall upon the first use of the interface. As a side effect, this appears to fix brk()/sbrk() usage in executables run with rtld direct exec, since the kernel and libc.so no longer maintain separate views of the process' break address. PR: 228574 Reviewed by: kib (previous version) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D15663 Notes: svn path=/head/; revision=334626
* Remove support for SYS_sys_exit in favor of SYS_exit.Brooks Davis2018-06-011-4/+0
| | | | | | | | SYS_exit has been defined in the repo since 1994 except for a brief window when SYS_sys_exit was defined in 2000. Notes: svn path=/head/; revision=334500
* Replace MD assembly exect() with a portable version.Brooks Davis2018-04-123-56/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Originally, on the VAX exect() enable tracing once the new executable image was loaded. This was possible because tracing was controllable through user space code by setting the PSL_T flag. The following instruction is a system call that activated tracing (as all instructions do) by copying PSL_T to PSL_TP (trace pending). The first instruction of the new executable image would trigger a trace fault. This is not portable to all platforms and the behavior was replaced with ptrace(PT_TRACE_ME, ...) since FreeBSD forked off of the CSRG repository. Platforms either incorrectly call execve(), trigger trace faults inside the original executable, or do contain an implementation of this function. The exect() interfaces is deprecated or removed on NetBSD and OpenBSD. Submitted by: Ali Mashtizadeh <ali@mashtizadeh.com> Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D14989 Notes: svn path=/head/; revision=332443
* Remove caching from getlogin(2).Brooks Davis2018-04-062-51/+1
| | | | | | | | | | | | | | | | This caching has existed since the CSRG import, but serves no obvious purpose. Sure, setlogin() is called rarely, but calls to getlogin() should also be infrequent. The required invalidation was not implemented on aarch64, arm, mips, amd riscv so updates would never occur if getlogin() was called before setlogin(). Reported by: Ali Mashtizadeh <ali@mashtizadeh.com> Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14965 Notes: svn path=/head/; revision=332119
* Remove architecture specific sigreturn.S files.Brooks Davis2018-04-042-49/+1
| | | | | | | | | | | | | All of these files are identical (modulo license blocks and VCS IDs) to the files generated by lib/libc/sys/Makefile.inc and serve no purpose. Reported by: Ali Mashtizadeh <ali@mashtizadeh.com> Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14953 Notes: svn path=/head/; revision=332048
* Remove bogus checks against NCARGS.John Baldwin2018-01-311-1/+1
| | | | | | | | | | | | NCARGS isn't a limit on the number of arguments to pass to a function, but the number of bytes that can be consumed by arguments to exec. As such, it is not suitable for a limit on the count of arguments passed to makecontext(). Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=328631
* revert r322589: force use of ld.bfd for linking i386 libcEd Maste2017-12-161-10/+0
| | | | | | | | | | As of r326897 ld.lld can link a working i386 libc.so, so we no longer need to force use of ld.bfd. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=326908
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2516-6/+38
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* force use of ld.bfd for linking i386 libc, even when using lldEd Maste2017-08-161-0/+10
| | | | | | | | | | | lld can successfully link most of a working i386 userland and kernel, but produces a broken libc. For now if we're otherwise using lld, and ld.bfd is available, explicitly use it for libc. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=322589
* Correct an misunderstanding of MDSRCS.Brooks Davis2017-03-021-1/+1
| | | | | | | | | | | | | | | MDSRCS it intended to allow assembly versions of funtions with C implementations listed in MISRCS. The selection of the correct machdep_ldis?.c for a given architecture does not follow this pattern and the file should be added to SRCS directly. Reviewed by: emaste, imp, jhb MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9841 Notes: svn path=/head/; revision=314557
* Correct MDSRCS use in <arch>/string/Makefile.inc.Brooks Davis2017-03-021-4/+21
| | | | | | | | | | | | | | | | - Remove .c files which duplicate entries in MISRCS. - Use the same, less merge conflict prone style in all cases. - Use MDSRCS for mips (.c and .S files both ended up in SRCS). - Remove pointless sparc64 Makefile.inc. - Remove uninformative foreign VCS ID entries. Reviewed by: emaste, imp, jhb MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9841 Notes: svn path=/head/; revision=314556
* Renumber copyright clause 4Warner Losh2017-02-2815-15/+15
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Reduce duplicate NOASM and PSEUDO definitionsBrooks Davis2016-09-081-4/+1
| | | | | | | | | | | | | | | | The initial value of NOASM is nearly the same in all cases and the initial value of PSEUDO is the same in all cases so reduce duplication (and hopefully, future merge conflicts) by machine independent defaults. Also document the PSEUDO variable. Reviewed by: jhb, kib Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D7820 Notes: svn path=/head/; revision=305630
* Rewrite ptrace(2) wrappers in C.Konstantin Belousov2016-08-292-60/+1
| | | | | | | | | | | | | Besides removing hand-translation to assembler, this also adds missing wrappers for arm64 and risc-v. Reviewed by: emaste, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D7694 Notes: svn path=/head/; revision=305012
* Do not obliterate errno value in the main thread during ptrace(2) call on x86.Konstantin Belousov2016-08-271-6/+8
| | | | | | | | | | | | | | | | | Since ptrace(2) syscall can return -1 for non-error situations, libc wrappers set errno to 0 before performing the syscall, as the service to the caller. On both i386 and amd64, the errno symbol was directly referenced, which only works correctly in single-threaded process. Change assembler wrappers for ptrace(2) to get current thread errno location by calling __error(). Allow __error interposing, as currently allowed in cerror(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=304928
* Remove unusedd and obsolete openbsd_poll system call. (Phase 1)George V. Neville-Neil2016-08-181-1/+1
| | | | | | | | | Reported by: brooks Reviewed by: brooks,jhb Differential Revision: https://reviews.freebsd.org/D7548 Notes: svn path=/head/; revision=304395
* Implement userspace gettimeofday(2) with HPET timecounter.Konstantin Belousov2016-08-172-116/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now, userspace (fast) gettimeofday(2) on x86 only works for RDTSC. For older machines, like Core2, where RDTSC is not C2/C3 invariant, and which fall to HPET hardware, this means that the call has both the penalty of the syscall and of the uncached hw behind the QPI or PCIe connection to the sought bridge. Nothing can me done against the access latency, but the syscall overhead can be removed. System already provides mappable /dev/hpetX devices, which gives straight access to the HPET registers page. Add yet another algorithm to the x86 'vdso' timehands. Libc is updated to handle both RDTSC and HPET. For HPET, the index of the hpet device to mmap is passed from kernel to userspace, index might be changed and libc invalidates its mapping as needed. Remove cpu_fill_vdso_timehands() KPI, instead require that timecounters which can be used from userspace, to provide tc_fill_vdso_timehands{,32}() methods. Merge i386 and amd64 libc/<arch>/sys/__vdso_gettc.c into one source file in the new libc/x86/sys location. __vdso_gettc() internal interface is changed to move timecounter algorithm detection into the MD code. Measurements show that RDTSC even with the syscall overhead is faster than userspace HPET access. But still, userspace HPET is three-four times faster than syscall HPET on several Core2 and SandyBridge machines. Tested by: Howard Su <howard0su@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D7473 Notes: svn path=/head/; revision=304285
* Replace use of the pipe(2) system call with pipe2(2) with a zero flagsBrooks Davis2016-06-222-50/+1
| | | | | | | | | | | | | | | | | | | value. This eliminates the need for machine dependant assembly wrappers for pipe(2). It also make passing an invalid address to pipe(2) return EFAULT rather than triggering a segfault. Document this behavior (which was already true for pipe2(2), but undocumented). Reviewed by: andrew Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D6815 Notes: svn path=/head/; revision=302092
* libc: stop exporting curbrk and minbrk in the private namespaceEd Maste2016-03-241-2/+0
| | | | | | | | | | | | They are not used anywhere else in the base system and are an internal implementation detail that does not need to be exposed. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5728 Notes: svn path=/head/; revision=297238
* libc/{i386,amd64}: Do not export .cerror when building WITHOUT_SYMVEREd Maste2016-03-081-0/+1
| | | | | | | | | | | | | | | | | | Further to r240152 (i386) and r240178 (amd64), hide the .cerror symbol so that it is not exported if symbol versioning is not in use. Without this change WITHOUT_SYMVER libc contains .text relocations for .cerror, as described in LLVM PR 26813 (http://llvm.org/pr26813). This is a no-op for the regular build as the symbol version script already controls .cerror visibility. PR: 207712 Submitted by: Rafael EspĂ­ndola Reviewed by: jilles, kib Differential Revision: https://reviews.freebsd.org/D5571 Notes: svn path=/head/; revision=296474
* Switch libc from using _sig{procmask,action,suspend} symbols, whichKonstantin Belousov2015-08-292-40/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | are aliases for the syscall stubs and are plt-interposed, to the libc-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 was breaking signal semantic and rtld locking. The added __libc_sigprocmask and other symbols are hidden, they are not exported and cannot be called through PLT. The setjmp/longjmp functions for x86 were changed to use direct calls, and since PIC_PROLOGUE only needed for functional PLT indirection on i386, it is removed as well. The PowerPC bug of calling the syscall directly in the setjmp/longjmp implementation is kept as is. Reported by: Pete French <petefrench@ingresso.co.uk> Tested by: Michiel Boland <boland37@xs4all.nl> Reviewed by: jilles (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=287292
* Copy the fencing of the algorithm to do lock-less update and readingKonstantin Belousov2015-08-041-2/+56
| | | | | | | | | | | | | | | | | of the timehands, from the kern_tc.c implementation to vdso. Add comments giving hints where to look for the algorithm explanation. To compensate the removal of rmb() in userspace binuptime(), add explicit lfence instruction before rdtsc. On i386, add usual complications to detect SSE2 presence; assume that old CPUs which do not implement SSE2 also execute rdtsc almost in order. Reviewed by: alc, bde (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=286284
* Remove reboot.S (part of libc). It's not needed and was actuallyEdward Tomasz Napierala2015-07-072-46/+1
| | | | | | | | | | broken - returning 0 from reboot(2) resulted in SIGBUS. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=285240
* The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), andKonstantin Belousov2015-04-181-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x kernels which required padding before the off_t parameter. The fcntl(2) contains compatibility code to handle kernels before the struct flock was changed during the 8.x CURRENT development. The shims were reasonable to allow easier revert to the older kernel at that time. Now, two or three major releases later, shims do not serve any purpose. Such old kernels cannot handle current libc, so revert the compatibility code. Make padded syscalls support conditional under the COMPAT6 config option. For COMPAT32, the syscalls were under COMPAT6 already. Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to (partially) disable the removed shims. Reviewed by: jhb, imp (previous versions) Discussed with: peter Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=281714
* siglongjmp(): Preserve floating point exception flags on i386 and amd64.Jilles Tjoelker2014-06-091-1/+0
| | | | | | | | | | | | | Per POSIX, siglongjmp() shall be equivalent to longjmp() except that it must match sigsetjmp() instead of setjmp() and except for the effect on the signal mask. Therefore, it should preserve the floating point exception flags. This was fixed for longjmp() and _longjmp() in r180080 and r180081 for amd64 and i386 respectively. Notes: svn path=/head/; revision=267307
* Convert from WITHOUT_SYSCALL_COMPAT to MK_SYSCALL_COMPAT.Warner Losh2014-04-051-1/+1
| | | | Notes: svn path=/head/; revision=264155
* Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}Marcel Moolenaar2014-03-041-1/+1
| | | | | | | | | | | | | | if not already defined. This allows building libc from outside of lib/libc using a reach-over makefile. A typical use-case is to build a standard ILP32 version and a COMPAT32 version in a single iteration by building the COMPAT32 version using a reach-over makefile. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=262722
* Replace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it andAndreas Tobler2013-11-218-30/+20
| | | | | | | | | get rid of the __CONCAT and CNAME macros. Reviewed by: bde, kib Notes: svn path=/head/; revision=258451
* libc: Access _logname_valid more efficiently.Jilles Tjoelker2013-08-171-8/+1
| | | | | | | | | | | | | | The variable _logname_valid is not exported via the version script; therefore, change C and i386/amd64 assembler code to remove indirection (which allowed interposition). This makes the code slightly smaller and faster. Also, remove #define PIC_GOT from i386/amd64 in !PIC mode. Without PIC, there is no place containing the address of each variable, so there is no possible definition for PIC_GOT. Notes: svn path=/head/; revision=254463
* The getcontext() from the __fillcontextx() call in theKonstantin Belousov2013-05-281-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | check_deferred_signal() returns twice, since handle_signal() emulates the return from the normal signal handler by sigreturn(2)ing the passed context. Second return is performed on the destroyed stack frame, because __fillcontextx() has already returned. This causes undefined and bad behaviour, usually the victim thread gets SIGSEGV. Avoid nested frame and the need to return from it by doing direct call to getcontext() in the check_deferred_signal() and using a new private libc helper __fillcontextx2() to complement the context with the extended CPU state if the deferred signal is still present. The __fillcontextx() is now unused, but is kept to allow older libthr.so to be used with the new libc. Mark __fillcontextx() as returning twice [1]. Reported by: pgj Pointy hat to: kib Discussed with: dim Tested by: pgj, dim Suggested by: jilles [1] MFC after: 1 week Notes: svn path=/head/; revision=251047
* - Correct mispellings of the word occurrenceGabor Kovesdan2013-04-173-5/+5
| | | | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail) Notes: svn path=/head/; revision=249582
* Rework the __vdso_* symbols attributes to only make the symbols weak,Konstantin Belousov2013-01-301-0/+10
| | | | | | | | | | | | | but use normal references instead of weak. This makes the statically linked binaries to use fast gettimeofday(2) by forcing the linker to resolve references and providing the neccessary functions. Reported by: bde Tested by: marius (sparc64) MFC after: 2 weeks Notes: svn path=/head/; revision=246117
* libc/i386: Do not export .cerror.Jilles Tjoelker2012-09-0511-41/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=240152
* Executing CPUID with EAX set to 1 to actually get feature flags.David Xu2012-07-101-1/+1
| | | | | | | PR: 169730 Notes: svn path=/head/; revision=238328
* Use struct vdso_timehands data to implement fast gettimeofday(2) andKonstantin Belousov2012-06-222-1/+52
| | | | | | | | | | | | | | | | | | clock_gettime(2) functions if supported. The speedup seen in microbenchmarks is in range 4x-7x depending on the hardware. Only amd64 and i386 architectures are supported. Libc uses rdtsc and kernel data to calculate current time, if enabled by kernel. Hopefully, this code is going to migrate into vdso in some future. Discussed with: bde Reviewed by: jhb Tested by: flo MFC after: 1 month Notes: svn path=/head/; revision=237434
* mdoc: sort prologue macros.Joel Dahl2012-03-263-3/+3
| | | | Notes: svn path=/head/; revision=233520
* Make the sys/ucontext.h self-contained by changing the return typeKonstantin Belousov2012-02-011-1/+1
| | | | | | | | | | of __getcontextx_size(3) from size_t to int. PR: ports/164654 MFC after: 1 month Notes: svn path=/head/; revision=230864
* Add API for obtaining extended machine context states that cannot beKonstantin Belousov2012-01-212-1/+134
| | | | | | | | | | | | | | fit into existing mcontext_t. On i386 and amd64 do return the extended FPU states using getcontextx(3). For other architectures, getcontextx(3) returns the same information as getcontext(2). Tested by: pho MFC after: 1 month Notes: svn path=/head/; revision=230429
* Change index() and rindex() to a weak alias.Ed Schouten2012-01-052-2/+2
| | | | | | | | | | | This allows people to still write statically linked applications that call strchr() or strrchr() and have a local variable or function called index. Discussed with: bde@ Notes: svn path=/head/; revision=229571
* Merge index() and strchr() together.Ed Schouten2012-01-035-137/+7
| | | | | | | | | | | | | | | | | | | | As I looked through the C library, I noticed the FreeBSD MIPS port has a hand-written version of index(). This is nice, if it weren't for the fact that most applications call strchr() instead. Also, on the other architectures index() and strchr() are identical, meaning we have two identical pieces of code in the C library and statically linked applications. Solve this by naming the actual file strchr.[cS] and let it use __strong_reference()/STRONG_ALIAS() to provide the index() routine. Do the same for rindex()/strrchr(). This seems to make the C libraries and static binaries slightly smaller, but this reduction in size seems negligible. Notes: svn path=/head/; revision=229368
* Despite official i386 ABI does not mandate any stack alignment besidesKonstantin Belousov2011-11-022-0/+28
| | | | | | | | | | | the word alignment, some versions of gcc do require 16-byte alignment. Make sure the stack is 16-byte aligned before calling a subroutine. Inspired by: PR amd64/162214 MFC after: 1 week Notes: svn path=/head/; revision=227024
* Replace a proliferation of buggy MD implementations of modf() with aDavid Schultz2011-10-213-89/+1
| | | | | | | | | | working MI one. The MI one only needs to be overridden on machines with non-IEEE754 arithmetic. (The last supported one was the VAX.) It can also be overridden if someone comes up with a faster one that actually passes the regression tests -- but this is harder than it sounds. Notes: svn path=/head/; revision=226606
* Remove duplicate .note.GNU-stack section declaration. bcopy alreadyKonstantin Belousov2011-02-042-4/+0
| | | | | | | | | made the neccessary provisions. Reported by: arundel Notes: svn path=/head/; revision=218303