summaryrefslogtreecommitdiffstats
path: root/lib/csu/boot.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Simplify the relocation code for the ld.so bootstrap and static pie: trackguenther2015-12-061-132/+71
| | | | | | | | just the dynamic tags are needed instead of reusing the generic elf_object_t structure. testing and feedback from miod@ ok kettenis@
* Make sure we set PROT_EXEC on the GOT for BSS-PLT binaries on powerpc.kettenis2015-09-191-2/+10
| | | | ok guenther@
* Do not include os-note-elf.h here, otherwise we end up with duplicate OS noteskettenis2015-08-171-3/+1
| | | | | | in our binaries. ok miod@
* static pie support for sparc.miod2015-07-031-2/+3
|
* <sys/param.h> is not needed here either.deraadt2015-01-161-2/+1
| | | | ok guenther millert doug
* Make the PLT read-only on powerpc as well.kettenis2014-12-291-2/+2
| | | | ok kurt@
* Static PIE support for alpha.kettenis2014-12-271-2/+36
| | | | | | | | | | | | | This adds alpha-specific first-pass GOT relocation code to boot.h. The assembly code is pure magic. The numeric register names don't make it easier to understand (or compare with the equivalent ld.so code). Unfortunately the assembler only understands a few symbolic register names. Renames the crt0.o entry point to __start. Our compiler was already using __start and the linker will soon follow. ok kurt@
* Use archdep.h GOT_PERMS define for mprotect of GOT. okay kettenis@kurt2014-12-251-2/+2
|
* Expand Elf_Rel relocations to include DT_JMPREL. Inspect DT_PLTREL valuekurt2014-12-241-6/+21
| | | | | | | | to determine if DT_JMPREL relocations are REL or RELA and conditionally perform DT_JMPREL in either REL or RELA as needed (idea from kettenis@). Remove unneeded i386 RELA implementation. i386 static pie working now. okay kettenis@
* Fix previos. Pointed out by kurt@.kettenis2014-12-241-2/+2
|
* Use the page size passed by the kernel in the Auxilliary Vector to handlekettenis2014-12-231-5/+11
| | | | architectures with variable page size.
* Make sure the GOT and PLT are not writable.kettenis2014-12-231-1/+23
| | | | | | | | | | Note that ommitting PROT_EXEC for the PLT is deliberate; static PIE binaries should never actually hit the PLT. We're still debating what to do when mprotect(2) fails. But that is no excuse not to at least attempt to fix things up. ok deraadt@
* When skipping a relocation because the referenced symbol is undefined, makekettenis2014-12-221-5/+7
| | | | | | sure we move on to the next relocation entry. While there, also skip relocations for REL architectures.
* Introduce new csu0 variant for -static -pie binaries to use calledkurt2014-12-221-0/+250
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@