summaryrefslogtreecommitdiff
path: root/lib/libc/arch
AgeCommit message (Collapse)Author
2024-06-04enable -fret-clean on amd64, for libc libcrypto ld.so kernel, and all theTheo de Raadt
ssh tools. The dynamic objects are entirely ret-clean, static binaries will contain a blend of cleaning and non-cleaning callers.
2024-04-15remove unused __bswap16, __bswap32 MD functions from arm and aarch64Christian Weisgerber
ok miod@
2024-04-15drop htonl(), htons(), ntohl(), ntohs() MD functions from libcChristian Weisgerber
Userland code compiled in a normal fashion picks up the htonl(), htons(), ntohl(), ntohs() macros implemented by endian.h. The functions in libc are effectively unused. Keep the MI functions in case something looks for the symbols in libc or plays games with #undef, but change them to wrap the implementation from endian.h. tweaks suggested by claudio@, ok miod@
2006-10-10Preliminary userland bits for OpenBSD/landisk, many things coming fromMiod Vallat
NetBSD.
2024-03-29Do not include <machine/frame.h> in libc sparc64 fpu routines, they don'tMiod Vallat
need any of its contents. ok claudio@ kettenis@
2024-03-27When the syscall number has to be loaded from a pc-relative location,Miod Vallat
abuse END macros to place the number at the end of the syscall wrapper rather than in the middle of it, so that there is no need to branch around it; this saves two instructions per syscall number >= 128. While there, also tweak the error return (SET_ERRNO_AND_RETURN) to only return a 64-bit value for lseek; this saves another instruction for all other syscalls. With input from guenther@; "Anything that makes the machine faster" deraadt@
2024-03-02Shorter and simpler version which does not need to use the stack.Miod Vallat
2024-03-02Provide the missing fabsl alias to fabs.Miod Vallat
No shlib_version change needed, jumping on the version bump of the mkdtems addition.
2023-12-13Move a large part of SYS.h defines to DEFS.h to match where other platformsMiod Vallat
put their macros, and also turn a few "EXIT" into "END" for consistency with other platforms. NFCI ok kettenis@ deraadt@
2023-12-11Make sure the syscall table entries are aligned on a 4-byte boundary.Mark Kettenis
Required for strict-alignment architectures and a good idea on others. ok deraadt@
2023-12-11arm just had to be different and change the syntax for .pushsectionTheo de Raadt
arguments, so we have to cope.
2023-12-11Oops, wrong argument to macroTheo de Raadt
2023-12-10Populate the non-LOAD openbsd.syscalls section (and PT_OPENBSD_SYSCALL)Theo de Raadt
with {uint offset, uint syscall#} entries in libc & ld.so. In libc a few syscall# entries (break, sigprocmask, _tfork, _threxit) are duplicated because additional or inline uses occur (that situation is handled elsewhere) ok kettenis
2023-12-06Move CALLSYS_NOERROR macro from <machine/asm.h> to libc, and expand it forMiod Vallat
non-libc users. This is a two-liner macro anyway, and this will make deraadt@'s future changes in this area easier to make. NFC
2023-08-13Make sure modf() returns correct values for infinities. While there, dropMiod Vallat
the few assembler versions as has been done on other *BSD systems; this function (modf) turns out to be non-trivial enough, having only one known-to-work version is preferrable. Reported by Willemijn Coene.
2023-05-18memmove() entry point is declared with NENTRY() and isn't consecutivePhilip Guenther
with an ENTRY(), so it needs its own endbr64 for IBT ok deraadt@
2023-05-18Make two corrections to the vfork(2) stub:Philip Guenther
* with IBT, it can't return via an indirect jump as that would require the *caller* to have an endbr64 * to support a potential vmspace-sharing implementation, keep the retguard value in an arg register across the underlying syscall ok kettenis@ deraadt@
2023-05-11Retguard addition in commit 72pYktDvmJhq7OyF was based on the understandingPhilip Guenther
that the removal of the off_t padding, amd64 syscalls no longer passed a 7th or later argument. We overlooked that syscall(2) bumps the arg count by one, so six argument calls like SYS_sysctl still pass an argument on the stack. So, repush the 7th argument so it's at the expected stack offset after the retguard register is pushed. problem reported and ok bluhm@
2023-03-31Since all arm64 assembly code in libc uses the ENTRY* macros fromMark Kettenis
<machine/asm.h> they are already get the necessary "bti c" instructions. Passi the -mmark-bti-property option to mark the corresponding object files as having BTI support. ok deraadt@
2023-02-11Use a consistent comment to explain why 32bit archs set their secondPhilip Guenther
return register to -1 in the syscall error path ("for lseek"). removal of the misleading __syscall() mention requested by deraadt@ ok deraadt@
2023-02-07remove seatbeltTheo de Raadt
2023-02-05remove --no-execute-only seatbeltTheo de Raadt
2023-02-05Implement usertc corresponding to the Allwinner A64 agtimer(4) errata.Mark Kettenis
ok cheloha@, semarie@
2023-01-27Use stricter constraints in the assembly statements in fpset{mask,round,sticky}Miod Vallat
and make them behave as intended again. The existing constraints are too weak; this used to work in older days, but got broken when the system compiler was updated to gcc 4 (or maybe even gcc 3).
2023-01-13Move all data from .text section to .rodata, and update the code toMiod Vallat
fetch them correctly when building PIC. ok kettenis@
2023-01-11block --execute-only on mips64 & sparc64 during the upcoming transition.Theo de Raadt
a seatbelt, because libc build corruption is too painful.
2023-01-11do not need --execute-only anymore, it is now the defaultTheo de Raadt
2023-01-11Add retguard to amd64 syscalls.Todd Mortimer
Since we got rid of padded syscalls we have enough registers to do this. ok deraadt@ ok kettenis@
2022-12-27spelling fixes; from paul tagliamonteJason McIntyre
any changes not taken noted on tech, but chiefly here i did not take the cancelation - cancellation changes;
2022-12-24Build libc with executable-only .text on arm64.Mark Kettenis
ok deraadt@
2022-12-24Don't use a literal pool in .text to load the setjmp magic value as this isMark Kettenis
incompatible with executable-only code. ok deraadt@, guenther@
2022-12-24Use the correct instruction to clear the frame pointer.Mark Kettenis
ok guenther@, deraadt@
2022-12-08_C_LABEL() and _ASM_LABEL() are no longer useful in the "everythingPhilip Guenther
is ELF" world. Eliminate use of them in landisk code. ok deraadt@
2022-12-08_C_LABEL() and _ASM_LABEL() are no longer useful in the "everythingPhilip Guenther
is ELF" world. Eliminate use of them in amd64, arm64, armv7, i386, macppc, mips64, and sparc64 code. ok deraadt@ jca@ krw@
2022-12-07_C_LABEL() and _ASM_LABEL() are no longer useful in the "everythingPhilip Guenther
is ELF" world. Eliminate use of them in powerpc64 code. ok gkoehler@
2022-12-06_C_LABEL() and _ASM_LABEL() are no longer useful in the "everythingPhilip Guenther
is ELF" world. Eliminate use of them in m88k code. ok aoyama@
2022-12-04Fix warnings about binding changed to STB_WEAK on i386Theo Buehler
Compiling libc on i386 results in compiler warnings for bcmp, bzero, bcopy, brk, and sbrk. Use ENTRY_NB instead of ENTRY to avoid this. ok jca millert
2022-12-03Add ENTRY_NB() and use it for brk.S and sbrk.S on riscv64Jeremie Courreges-Anglas
NB for "No Binding". This gets us rid of clang-13 warnings about a global symbol redefined as weak. Mostly a copy of what guenther@ already implemented on other archs. ok guenther@ tb@
2022-12-02Drop _C_LABEL() uses in riscv64-specific codeJeremie Courreges-Anglas
_C_LABEL() was useful in the a.out->ELF transition days, way before RISC-V was a thing. Also drop uses of _ASM_LABEL() while here, suggested by guenther@ ok guenther@
2022-11-05powerpc64: TimeBase: add userspace timecounting supportScott Soule Cheloha
Tested by gkoehler@. ok gkoehler@
2022-09-22use the always serializing RDTSCP instruction in tsc and usertc if availableRobert Nagy
tweaks from cheloha@; ok deraadt@, sthen@, cheloha@
2022-09-03Fix the failing libm/rint regress test by adding ieee754 implementationsMoritz Buhl
for the rounding functions. Input from kettenis@, OK miod@
2022-09-02Use a shorter system call invocation template for system calls in the rangeMiod Vallat
0-127, where immediate addressing can be used to load the system call number in r0, rather than performing a memory load using pc-relative addressing. No functional change, but rm(1) runs a couple cycles faster per file now.
2022-08-29use ansi volatile keyword, not __volatileJonathan Gray
ok miod@ guenther@
2022-06-10Add _?ENTRY_NB() macro for doing an ASM function entry withoutPhilip Guenther
setting the binding to global (NB == "no binding"), as clang 13 is now warning about changing the binding from global to weak. Use them for bcopy, brk, and sbrk. Add the '.L' prefix to internal labels in the bcopy implementation to remove them from the symbol table Start using the MI DEFS.h: delete the #defines from powerpc/SYS.h that the MI DEFS.h provides and switch from SYS.h to DEFS.h in files that don't do syscalls. Use END_BUILTIN from the MI DEFS.h for ffs. ok gkoehler@
2022-05-25Revert the .rodata.cst4 change: results in incorrect value readPhilip Guenther
2022-05-24Delete superfluous/duplicated #includesPhilip Guenther
2022-05-24Give internal 'botch' labels a '.L' prefix to remove them from thePhilip Guenther
symbol table ok kettenis@ miod@
2022-05-24Address the clang 13 "changed binding to STB_WEAK" warning on arm64:Philip Guenther
add _?ENTRY_NB to asm.h, switch libc's asm bits to the generic DEFS.h, and use ENTRY_NB as necessary. Also, give sizes to the htonl/htons symbols and mark them as weak. ok kettenis@ miod@
2022-05-24Set the correct alignment on __jmpxor (.align's meaning is MD!)Philip Guenther
Put .L_setjmp_magic in the correct ELF section for duplicate suppression Rename the "botch" label to delete it from the symbol table ok kettenis@ miod@