summaryrefslogtreecommitdiffstats
path: root/lib/csu/boot.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* retire sparctedu2016-09-011-2/+2
|
* Look for a PT_GNU_RELRO section and, if present, mprotect that rangeguenther2016-08-081-8/+24
| | | | | | | | | | instead of the [__got_start, __got_end) range. Also, instead of mprotecting the [__plt_start, __plt_end) range, just scan for sections which are both writable and executable and mprotect them to read-only. (This part was stolen from kettenis@) ok kettenis@
* Teach mips64 to pass &_DYNAMIC to _dl_boot_bind().guenther2016-08-071-6/+1
| | | | mips64be testing by deraadt@
* alpha already calculates &_DYNAMIC for the _reloc_alpha_got() call, soguenther2016-08-071-4/+2
| | | | save that and pass it to _dl_boot_bind() too
* Teach i386 to pass &_DYNAMIC to _dl_boot_bind()guenther2016-08-071-2/+2
|
* Psych: amd64 has been passing &_DYNAMIC to _dl_boot_bind() for 19 monthsguenther2016-08-071-2/+2
|
* Flip the #ifdef logic: amd64, i386, and mips64 were the only static PIEguenther2016-08-071-5/+4
| | | | archs using the #else case
* Missed a reference to dl_prebind.hguenther2016-07-051-2/+1
| | | | problem noted by Andrew Ngo (andrew.ngo (at) gmail.com)
* Call mprotect() via its hidden _lib_mprotect alias to avoid accidentalguenther2016-03-121-1/+8
| | | | | | overriding ok deraadt@ kettenis@
* 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@