summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Mark the _Qp_{mul,div,add,sub} functions as 'protected' to eliminateguenther2019-10-271-2/+3
| | | | | | PLT entries and prevent overriding ok kettenis@ deraadt@
* Stop exporting the internal _mcount symbol as that's only referencedguenther2019-10-265-5/+0
| | | | | | | by the ASM stub, which is also in libc. The compiler only generates invocations of the latter. ok mpi@ deraadt@ kettenis@
* Unexport __floatundidf.kettenis2019-10-231-1/+0
| | | | ok deraadt@
* Unlike gas, clang's assembler complains about duplicate symbol assignments.guenther2019-07-141-2/+2
| | | | | | Tweak the PSEUDO() macro to avoid that. problem noted and tested by kettenis@
* Fix conversions to long double on sparc64jca2019-06-212-12/+12
| | | | | | | | | | | | | | | | | | | | | | | Bug exposed by erratic sqlite3 behavior used in ports/devel/proj, as pointed out by landry@. Richard Hipps (SQLite) pointed at the culprit (_Qp_div), many thanks. Adapted from FreeBSD revision 146673 by Stephen Paskaluk and stefanf@FreeBSD. FreeBSD commit message: """ Fix long (and long long) to long double, unsigned to long double and unsigned long (and unsigned long long) to long double conversions. - Add a parameter that specifies the position of the sign bit to the _QP_TTOQ macro, previously it always looked at bit 31. Pass a negative number to disable sign inspection for unsigned types. This fixes _Qp_xtoq(), _Qp_uitoq() and _Qp_uxtoq(). - In the functions __fpu_itof() and __fpu_xtof(), look at the sign bit to decide whether we're doing a conversion from an unsigned type. If so, don't negate the mantissa if the integer exceeds the biggest signed number. """ ok deraadt@
* Apply retpoline protection to the indirect call to the thread startfuncguenther2019-05-101-2/+7
| | | | ok mortimer@
* Compile with -gdwarf-4 to suppress wrnings about DWARF2 in assembly codekettenis2019-04-011-1/+4
| | | | | | that includes retguard code. ok mortimer@
* Add retguard macros to setjmp/longjmp on amd64. Knocks out some usefulmortimer2019-03-303-21/+33
| | | | | | gadgets from libc. ok deraadt@, kettenis@
* Remove FBSDID.kevlo2019-03-1511-53/+11
| | | | ok deraadt@
* Replace two-operand instruction aliases that clang does notvisa2019-01-051-2/+2
| | | | | | understand with the three-operand instructions. No binary change with gas.
* Add retguard to arm64 libc syscalls and setjmp / longjmp.mortimer2018-10-013-6/+29
| | | | ok kettenis@
* Add retguard macros for arm64 asm and apply them in the straightforwardmortimer2018-08-1210-10/+30
| | | | | cases in kernel and libc. ok deraadt@
* In asm.h ensure NENTRY uses the old-school nop-sled align, but change standardderaadt2018-07-101-1/+1
| | | | | | | ENTRY is a trapsled. Fix a few functions which fall-through into an ENTRY macro. amd64 binaries now are free of double+-nop sequences (except for one assember nit in aes-586.pl). Previous changes by guenther got us here. ok mortimer kettenis
* Add retguard macros for libc.mortimer2018-07-0323-23/+72
| | | | ok deraadt
* Save and restore the relevant FPU state on armv7.kettenis2018-06-223-28/+26
| | | | ok deraadt@
* Add add PIE support for m88k (requires gcc4 toolchain)guenther2018-06-162-5/+7
| | | | | | Convert __cerror to hidden visibility. from miod@
* Drop include of <arm64/swi.h> and remove it.kettenis2018-05-281-2/+1
| | | | ok drahm@
* Clear the sign bit in the QNAN constants used by strtof, strtod and strtold,jmatthew2018-05-284-16/+16
| | | | | | so passing "nan" and "-nan" produces a NaN with the right sign. Bug reported and diff provided by George Koehler. ok kettenis@
* Drop memory barrier in _atomic_lock() implementation since the callers nowkettenis2018-05-172-4/+2
| | | | | | take care of this. ok visa@, mpi@
* Since most (if not all) ARMv8 hardware doesn't actually support trapping ofkettenis2018-03-162-73/+26
| | | | | | | floating-point exceptions, simplify the functions that control the exception masks just like we did on armv7. ok tom@
* Change floating-point mode/environment control functions to operate onkettenis2018-02-287-1/+215
| | | | | | | | | | both the hardfloat (FPU registers) and softfloat (software) state. This makes these functions work correctly when mixing hardfloat and softfloat code. Disable trapping for softfloat since most (if not all) ARMv7 and ARMv8 hardware that is on the market doesn't support trapping of floating-point exceptions. ok patrick@
* use END_STRONG. Yes, everything in the sh ecosystem is different..deraadt2018-01-231-2/+2
|
* Implement ffs(3) using the CLZ instructions which has been available everkettenis2018-01-211-43/+6
| | | | | | | | | since ARMv5. Should be much faster but more importantly it removes the data table from .text which could introduce unwanted ROP gadgets. Based on changes in Android/Bionic by Elliott Hughes. ok patrick@
* Partial revert of rev. 1.7, fixes build with clangjca2018-01-191-2/+1
| | | | | | | | | | | The error was: --8<-- ffs.S:57:2: error: unsupported relocation on symbol adrne r2, .L_ffs_table ^ -->8-- Minimal workaround suggested by deraadt@, ok guenther@ kettenis@
* Wow, it cannot even be in .data...deraadt2018-01-181-2/+1
|
* Sorry, the PIC macros cannot reach to .rodata....deraadt2018-01-181-2/+2
|
* Instead of trying to handle ffs() with the normal rename-mark-hidden-and-aliasguenther2018-01-187-15/+24
| | | | | | | dance, mark it protected. This works better for both gcc and clang: gcc blocks overriding of internal calls, while clang permits inlining again. ok otto@
* Add two more ARM EABI aliases that I missed in the previous libc minorkettenis2018-01-141-0/+2
| | | | | | bump. "just go ahead -- crank" deraadt@
* Move SC_* defines into <machine/setjmp.h>, and rename them,visa2018-01-082-158/+158
| | | | | | so that <machine/signal.h> is not needed in setjmp.S. Suggested by kettenis@ long ago, OK deraadt@
* Add ARM EABI runtime aliases to the GCC runtime functions that we includekettenis2017-12-262-1/+32
| | | | | | in libc. ok patrick@, jsg@, guenther@
* Don't use _libc_ prefix when referencing "builtin" symbols with clang.kettenis2017-12-162-3/+8
| | | | Slightly tweaked diff from guenther@
* clang doesn't propagate attributes like "asm labels" and "visibility(hidden)"guenther2017-11-2925-69/+119
| | | | | | | | | to builtins like mem{set,cpy,move} and __stack_smash_handler. So, when building with clang, instead mark those as protected visibility to get rid of the PLT relocations. We can't take the address of them then, but that's ok: it's a build-time error not a run-time error. ok kettenis@
* GNU ld has prefixed the contents of .gnu.warning.SYMBOL sectionstb2017-11-282-4/+4
| | | | | | | | with "warning: " since 2003, so the messages themselves need not contain the prefix anymore. From Scott Cheloha ok jca, deraadt
* Avoid .align 0 here as well. Also fix a .word that should be a .quad.kettenis2017-11-223-10/+7
| | | | ok patrick@
* Avoid .align 0. Clang's integrated assembler actually honors this directivekettenis2017-11-213-9/+6
| | | | | | and the resulting byte-alignment triggers unaligned access. ok patrick@, deraadt@
* Stop exporting _memcpy, an implementation detail of bcopy/memcpy/memmoveguenther2017-10-295-9/+10
| | | | ok kettenis@ deraadt@
* Remove __builtin_saveregs: gcc hasn't used it for years.guenther2017-10-283-63/+2
| | | | | suggested by miod@ ok kettenis@
* Typo: 'end' should have been '_end', which is already exported/imported.guenther2017-10-282-5/+2
| | | | | Also, '_memcpy' and '_stack' were specific to arm and should not have been copied here
* Stop exporting some symbols internal to the softfloat implementation,kettenis2017-10-281-27/+0
| | | | | | | | | unneeded linker-generated symbols and libgcc symbols that are accidentally re-exported. Riding the upcoming libc major bump. ok guenther@
* Do not use an uninitialized value when determining the signvisa2017-10-151-4/+4
| | | | | | | | | | of a denormal result of ldexp(3). The bug was found when investigating why denormal results of pow(3) can have an incorrect sign on loongson. pow(3) misbehaviour reported and fix tested by juanfra@ No objection from deraadt@
* Use 0xcc trapsleds instead of default/nop/0xcc in BTC alignmentsderaadt2017-08-193-6/+6
|
* Don't need .text before ENTRY(), also minor spacing cleanupsderaadt2017-08-194-13/+8
|
* Put _map table into .rodata instead of .textderaadt2017-08-192-5/+4
|
* Copy files from ../librthread in preparation for moving functionalityguenther2017-08-151-0/+49
| | | | | | | from libpthread to libc. No changes to the build yet, just making it easier to review the substantive diffs. ok beck@ kettenis@ tedu@
* Copy files from ../librthread in preparation for moving functionalityguenther2017-08-1510-0/+371
| | | | | | | from libpthread to libc. No changes to the build yet, just making it easier to review the substantive diffs. ok beck@ kettenis@ tedu@
* Remove branch prediction hint from conditional branch instruction.naddy2017-06-011-2/+2
| | | | | These hints are not recognized by clang's builtin assembler. From the corresponding amd64 change. ok visa@ kettenis@
* Always return nonzero from _longjmp too.kettenis2017-04-161-2/+3
| | | | ok jsg@
* Provide the necessary weak alias for fpgetround(). Delete the obsoleteguenther2017-03-222-10/+3
| | | | | | | __weak_alias() uses problem noted by drahn@ ok kettenis@
* Use the hidden aliases to avoid PLT entries for {,_}{set,long}jmpguenther2017-03-221-9/+8
| | | | | | | Set the size of the sig{set,long}jmp symbols testing help jsg@ ok kettenis@
* Stop setting the second register; it's unnecessary on 64bit archsguenther2017-03-191-2/+1
| | | | ok patrick@ kettenis@