summaryrefslogtreecommitdiffstats
path: root/lib/csu (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce new csu0 variant for -static -pie binaries to use calledkurt2014-12-224-4/+315
| | | | | | | | | | | | | | | | | | rcsu0.o where the initial 'r' is for relocatable. rcsu0.o performs self-relocation on static pie binaries by calling a slightly modified copy of ld.so's _dl_boot_bind() in boot.h. The first arch implementatation is also included for amd64 where __start calls _dl_boot_bind() and then calls ___start(). Includes parts from kettenis@ to help get R_X86_64_64 relocations working and proper handling for undefined weak symbols. This is the first part of several to get static pie self-relocating binaries working. binutils, gcc and kernel changes are forthcoming to complete the solution, then per-arch implementations are needed for MD_RCRT0_START in csu. okay kettenis@ pascal@ deraadt@
* mop up a barely started project... getting in the way of grepping the tree!deraadt2014-11-222-152/+0
|
* Objects for the executable can be PIE instead of PIC, so remove the sparc64guenther2014-11-151-9/+1
| | | | | | special case; no binary change ok kettenis@
* ELF uberalles, so move the files up out of common_elfguenther2014-11-158-578/+14
| | | | ok miod@ deraadt@
* Merge Makefiles, moving the build up a level and putting the CPU-specificguenther2014-11-1215-858/+94
| | | | | | | build flags into conditionals in the Makefile, fixing a few inconsistencies in the process. \o/ miod@
* m68k is dead <sniff>guenther2014-11-103-134/+2
| | | | ok miod@
* It's been a quarter century: we can assume volatile is present with that name.guenther2014-04-181-2/+2
|
* Increase _STACKALIGNBYTES to 15 (was 7), and make sure the stack is alignedmiod2014-02-221-1/+3
| | | | | | | to a 16 byte boundary in csu (similar to what the other arches where _STACKALIGNBYTES != _ALIGNBYTES do). This is necessary for long double variables on the stack to be correctly aligned.
* build crt*S with -fPIC instead of -fpicmiod2014-01-141-2/+2
|
* Move atexit(3) into crtbegin.c and certbeginS.c such that we can pass thekettenis2013-12-284-4/+36
| | | | | | | | | | right __dso_handle and have dlopen'ed shared objects run their atexit handlers when they get unloaded. This is what Linux does, and several ports depend on this behaviour (and will crash upon exit without this chang). Based on an earlier diff from matthew@ Tested by ajacoutot@ ok deraadt@
* Add assembly code to set up the arguments for the common C startup code. Thiskettenis2013-12-231-29/+19
| | | | | | | means we no longer rely on how the C compiler sets up the initial stack frame and allows us to get rid of MD_NO_CLEANUP. ok deraadt@, guenther@
* Sync Makefile with what other platforms do; makes dependency tracking actuallykettenis2013-12-231-14/+45
| | | | | | work. ok deraadt@, guenther@
* Fix typo, allow hppa64 to build a little furthertobiasu2013-12-201-2/+2
|
* Fix static linking of libpthread: have crt0 invoke __init_tcb() if it'sguenther2013-12-122-2/+12
| | | | | | defined and we don't think ld.so has already done the TCB setup. ok and much discussion miod@
* correct frame handlingderaadt2013-12-041-8/+3
| | | | with and ok guenther
* Merge the per-arch crt0.c files into common_elf/crt0.c, with MD macros inguenther2013-12-0342-1775/+605
| | | | | | 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-014-17/+5
| | | | | | 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@
* The kernel and ld.so have passed 0 in r7 for use as the cleanupguenther2013-11-101-19/+5
| | | | | | | | | callback for about a year, so it's safe to make __start() treat that as the cleanup argument and conditionally pass it to atexit(). Eliminate the no-longer-used obj and ps_strings arguments to position things correctly, which lets us eliminate the ASM wrapper completely. ok kettenis@ miod@
* The kernel and ld.so pass 0 in %rdx for use as the cleanup callbackguenther2013-11-101-11/+6
| | | | | | | | for about a year, so it's safe to add the test and atexit() call. While here, drop the no-longer-used obj and ps_strings and the asm to set those up, switch from sys/param.h to limits.h, and ANSIfy. ok kettenis@
* Remove a.out leftovers. (it's september now)miod2013-09-082-348/+0
|
* VAX ELF userland bits. Consists mostly of register prefix additions.miod2013-07-053-88/+156
|
* Don't declare ___start static, for gcc4 would optimize it out.miod2013-05-081-2/+2
|
* Userland bits for m68k/ELF. Mostly addition of register prefixes to themiod2013-02-023-89/+165
| | | | | assembler instructions, and cope with the few changes in return values location.
* build crt{begin,end}S.o with -fpic.miod2013-01-151-3/+3
|
* Switch m88k ports to ELF.miod2013-01-053-56/+138
|
* Spell `calculation' correctly.miod2012-12-311-2/+2
|
* Register cleanup handler passed by ld.so with atexit(3).kettenis2012-12-241-6/+6
| | | | tested by benno@
* Register cleanup handler passed by ld.so with atexit(3). Fix stack alignment.kettenis2012-12-241-10/+7
| | | | ok guenther@
* Register cleanup handler passed by ld.so with atexit(3).kettenis2012-12-231-5/+7
|
* Explicitly align the stack on a 16-byte boundary such that constructors cankettenis2012-12-231-3/+5
| | | | | | | use SSE instructions. In principle we should be able to rely on the stack to be aligned properly, but the i386 calling convention makes this rather fragile. ok guenther@, deraadt@
* Register cleanup handler passed by ld.so with atexit(3).kettenis2012-12-221-8/+6
| | | | ok kurt@
* crtbeginS.o needs to be built with -fPIC, otherwise bloated shared librarieskettenis2012-12-191-1/+3
| | | | | | silently crash when running constructors. Tested by landry@. ok beck@
* Remove excessive sys/cdefs.h inclusionderaadt2012-12-057-14/+12
| | | | ok guenther millert kettenis
* Register cleanup handler passed by ld.so with atexit(3).kettenis2012-11-011-4/+5
| | | | ok kurt@
* Reverse the order that ctors and dtors are run in accordance withmatthew2012-09-084-28/+28
| | | | | | GCC's documentation. Fixes GNU C++'s init_priority attribute. ok miod
* Add __guard_local as a hidden symbol to ld.so, kernel, and everymatthew2012-08-284-4/+12
| | | | | | executable and DSO (via crtbegin.c/crtbeginS.c). Not used yet, but needed before GCC can start emitting -fstack-protector code that uses them instead of __guard.
* Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure ccpascal2012-08-222-4/+4
| | | | | | | 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@
* the fpu control symbol on sh (__fpscr_values) suddenly becomes localjsg2012-04-121-2/+5
| | | | | | | instead of global with gcc4 and this ends up breaking things in hard to debug ways. So move the definition to csu instead of libgcc. ok miod@
* Pass install the -S option to avoid a window where the target isn'tguenther2011-11-0815-30/+30
| | | | | | | 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@
* Use long calls like we do on hppa, otherwise the function we want to callkettenis2011-09-191-5/+12
| | | | might be unreachable.
* Make sure the stack is properly aligned for using SSE instructions. Whilekettenis2011-08-191-5/+10
| | | | | | | our in-tree compiler will emit code to do this at the start of main(), other compilers might not do that. ok miod@
* On hppa64 we need to use __gp instead of $global$.kettenis2011-07-091-3/+3
|
* enter ia64 for objderaadt2011-07-041-2/+2
|
* Add csu ia64 support.pirofti2011-07-043-0/+213
|
* Implement correct prologue and epilogue for hppa64.jsing2011-04-201-6/+6
| | | | ok kettenis@
* Make sure everything run from .init and .fini sections gets a properly alignedkettenis2011-03-311-2/+3
| | | | | | stack. ok fgsch@
* Make sure everything run from .init and .fini sections gets a properly alignedkettenis2011-03-301-2/+3
| | | | | | stack. ok deraadt@, fgsch@
* crtbeginS.o needs to be buit with -fPIC; with -fpic the relocations for thekettenis2010-12-241-1/+3
| | | | | | | gcc3/4 exception handling related symbols will be truncated causing linker failures when building shared libraries. ok drahn@, deraadt@, miod@
* Since the stack layout changes from gcc3 to gcc4, change the inline asm tokettenis2010-09-121-1/+5
| | | | | | deal with this. ok miod@