summaryrefslogtreecommitdiffstats
path: root/lib/csu/arm (follow)
Commit message (Collapse)AuthorAgeFilesLines
* replace ad-hoc illegal instruction with the architecturally defined onenaddy2020-10-191-2/+2
| | | | | ("permanently undefined") ok deraadt@ kettenis@
* crt0 MD _dl_exit() performs syscall to SYS_exit directly, but thenderaadt2020-10-151-1/+2
| | | | | | | | | | | some of these functions were returning. That makes the +1word address a fairly strong and easily located gadget. Put a hard-trap instruction after the syscall. This remains a gadget for 'terminal system' calls (such as execve), but hey that's why we have pledge w/o "exec" throughout the tree. Quite surprisingly, hppa's delay-slot load of SYS_exit makes it the safest of the bunch, not that this helps anyone. ok kettenis
* use symbolic SYS_exit instead of the value 1deraadt2020-10-141-2/+2
| | | | ok kettenis
* Anthony Steinhauser reports that 32-bit arm cpus have the same speculationderaadt2020-03-131-3/+3
| | | | | | | | | | | problems as 64-bit models. To resolve the syscall speculation, as a first step "nop; nop" was added after all occurances of the syscall ("swi 0") instruction. Then the kernel was changed to jump over the 2 extra instructions. In this final step, those pair of nops are converted into the speculation-blocking sequence ("dsb nsh; isb"). Don't try to build through these multiple steps, use a snapshot instead. Packages matching the new ABI will be out in a while... ok kettenis
* Anthony Steinhauser reports that 32-bit arm cpus have the same speculationderaadt2020-03-111-1/+3
| | | | | problems as 64-bit models. For the syscall instruction issue, add nop;nop after swi 0, in preparation for jumping over a speculation barrier here later.
* _dl_printf is no longer referenced by RELOC_{JMPREL,DYN,GOT}; delete the stubguenther2017-08-111-3/+1
| | | | ok kettenis@
* Use a long branch (using movw/movt) to implement MD_SECT_CALL_FUNC.kettenis2017-02-261-15/+5
| | | | | | Necessary (but perhaps not suffcient) to build large binaries on arm. ok guenther@
* Declare the symbols that label the .ctors, .dtors, .eh_frame, and .jcrguenther2017-01-211-1/+23
| | | | | | | | | | sections as extern hidden arrays of indefinite size, so that the compiler (well, clang) doesn't believe it knows the exact contents and thus optimize things into infinite loops. Actually set the symbols to be in the sections and insert the leading and trailing values via __asm(). Problem pointed out by patrick@ testing and ok kettenis@
* Simplify code that sets up a stack frame for running .init code to be morekettenis2016-10-031-5/+3
| | | | | | AEABI-like. ok tom@, jsg@
* Implement self-relocation for -static -pie on arm. Also removes somekettenis2016-09-081-9/+54
| | | | | | | unecessary code from the normal startup code and do some general cleanup to make the code more readable. ok guenther@, jsg@
* Unbreak arm and m88k: COPY relocations for weak symbols that are overloadedguenther2016-03-241-1/+6
| | | | | | | with strong symbols in ld.so don't do what we need, so put definitions back in crt0 and make ld.so update __progname like it does environ. report and testing patrick@ jsg@
* Rearrange C runtime bits: now that ld.so exports environ and __progname,guenther2016-03-201-10/+1
| | | | | | | | | | | move their definitions and initialization in static links to libc.a Make crt0 always invoke a new func _csu_finish() in libc to process the auxv and to either register the ld.so cleanup function (in dynamic links) or initialize environ and __progname and do MC_DISABLE_KBIND (in static links). In libc, get pagesize from auxv; cache that between getpagesize() and sysconf(_SC_PAGESIZE) ok mpi@ "good time" deraadt@
* In static binaries, invoke kbind() once to disable it.guenther2015-09-011-1/+10
| | | | | With much assistance from miod@ ok deraadt@@
* Merge Makefiles, moving the build up a level and putting the CPU-specificguenther2014-11-121-59/+0
| | | | | | | build flags into conditionals in the Makefile, fixing a few inconsistencies in the process. \o/ miod@
* Merge the per-arch crt0.c files into common_elf/crt0.c, with MD macros inguenther2013-12-033-136/+36
| | | | | | the md_init.h files. Worked out with and ok miod@; ok matthew@
* mips64 no longer uses scrt0.o, and it was identical to crt0.o anyway.guenther2013-12-011-3/+1
| | | | | | Delete unused #ifndef SCRT0 conditionals. ok miod@
* The kernel and ld.so have passed 0 in r0 for use as the cleanupguenther2013-11-101-11/+6
| | | | | | | | | | callback for about a year, so it's safe to make __start() pass that as the cleanup argument to ___start(), and have *that* conditionally pass it to atexit(). Eliminate the no-longer-used obj and ps_strings arguments to position things correctly, simplifying the ASM wrapper slightly. ok kettenis@ miod@; testing patrick@
* Remove excessive sys/cdefs.h inclusionderaadt2012-12-051-2/+1
| | | | ok guenther millert kettenis
* Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure ccpascal2012-08-221-2/+2
| | | | | | | invocations. This allows us to use the compiler builtin define __PIC__ to check for PIC/PIEness rather than passing -DPIC. Simplifies PIE work a lot. ok matthew@, conceptually ok kurt@
* Pass install the -S option to avoid a window where the target isn'tguenther2011-11-081-2/+2
| | | | | | | executable (by mode or content), which can trip up builds with 'make -j' (The generic fix is in share/mk/*; some Makefiles have their own INSTALL lines) ok millert@ deraadt@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-2/+1
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* fix rcs ids. ok sthen@martynas2009-06-211-1/+1
|
* Compile crt0.o, crtbegin.o and crtend.o with -fpie/-fPIE. This requireskurt2008-11-111-6/+6
| | | | | | gcc with pie support to be built first. ok kettenis@
* The recent change to bsd.own.mk to allow PICFLAG to be overridden madekurt2008-10-061-2/+0
| | | | | | | these previously ignored PICFLAG settings become active. Remove PICFLAG overrides to restore -fpic/-fPIC modes. In snaps for a week. okay drahn@
* The -DPIC flag must be passed when building crtbeginS.o/crtendS.o howeverdrahn2004-07-071-5/+5
| | | | | using PICFLAGS is not the proper way to do that. Put it directly in the build script. Fixes a problem with upcoming PICFLAG. ok deraadt@
* Proper PIC support in arm startup files.drahn2004-02-092-4/+11
|
* tag..drahn2004-02-011-0/+1
|
* startup files for arm. Partially borrowed from NetBSD.drahn2004-02-013-0/+264