summaryrefslogtreecommitdiffstats
path: root/lib/csu/arm
AgeCommit message (Collapse)AuthorFilesLines
2020-10-19replace ad-hoc illegal instruction with the architecturally defined onenaddy1-2/+2
("permanently undefined") ok deraadt@ kettenis@
2020-10-15crt0 MD _dl_exit() performs syscall to SYS_exit directly, but thenderaadt1-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
2020-10-14use symbolic SYS_exit instead of the value 1deraadt1-2/+2
ok kettenis
2020-03-13Anthony Steinhauser reports that 32-bit arm cpus have the same speculationderaadt1-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
2020-03-11Anthony Steinhauser reports that 32-bit arm cpus have the same speculationderaadt1-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.
2017-08-11_dl_printf is no longer referenced by RELOC_{JMPREL,DYN,GOT}; delete the stubguenther1-3/+1
ok kettenis@
2017-02-26Use a long branch (using movw/movt) to implement MD_SECT_CALL_FUNC.kettenis1-15/+5
Necessary (but perhaps not suffcient) to build large binaries on arm. ok guenther@
2017-01-21Declare the symbols that label the .ctors, .dtors, .eh_frame, and .jcrguenther1-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@
2016-10-03Simplify code that sets up a stack frame for running .init code to be morekettenis1-5/+3
AEABI-like. ok tom@, jsg@
2016-09-08Implement self-relocation for -static -pie on arm. Also removes somekettenis1-9/+54
unecessary code from the normal startup code and do some general cleanup to make the code more readable. ok guenther@, jsg@
2016-03-24Unbreak arm and m88k: COPY relocations for weak symbols that are overloadedguenther1-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@
2016-03-20Rearrange C runtime bits: now that ld.so exports environ and __progname,guenther1-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@
2015-09-01In static binaries, invoke kbind() once to disable it.guenther1-1/+10
With much assistance from miod@ ok deraadt@@
2014-11-12Merge Makefiles, moving the build up a level and putting the CPU-specificguenther1-59/+0
build flags into conditionals in the Makefile, fixing a few inconsistencies in the process. \o/ miod@
2013-12-03Merge the per-arch crt0.c files into common_elf/crt0.c, with MD macros inguenther3-136/+36
the md_init.h files. Worked out with and ok miod@; ok matthew@
2013-12-01mips64 no longer uses scrt0.o, and it was identical to crt0.o anyway.guenther1-3/+1
Delete unused #ifndef SCRT0 conditionals. ok miod@
2013-11-10The kernel and ld.so have passed 0 in r0 for use as the cleanupguenther1-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@
2012-12-05Remove excessive sys/cdefs.h inclusionderaadt1-2/+1
ok guenther millert kettenis
2012-08-22Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure ccpascal1-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@
2011-11-08Pass install the -S option to avoid a window where the target isn'tguenther1-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@
2009-10-27rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt1-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
2009-06-21fix rcs ids. ok sthen@martynas1-1/+1
2008-11-11Compile crt0.o, crtbegin.o and crtend.o with -fpie/-fPIE. This requireskurt1-6/+6
gcc with pie support to be built first. ok kettenis@
2008-10-06The recent change to bsd.own.mk to allow PICFLAG to be overridden madekurt1-2/+0
these previously ignored PICFLAG settings become active. Remove PICFLAG overrides to restore -fpic/-fPIC modes. In snaps for a week. okay drahn@
2004-07-07The -DPIC flag must be passed when building crtbeginS.o/crtendS.o howeverdrahn1-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@
2004-02-09Proper PIC support in arm startup files.drahn2-4/+11
2004-02-01tag..drahn1-0/+1
2004-02-01startup files for arm. Partially borrowed from NetBSD.drahn3-0/+264