Age | Commit message (Collapse) | Author |
|
ok guenther millert doug
|
|
value, which we have no use for. ok kettenis@
|
|
archdep.h help from kettenis@
|
|
ok kurt@
|
|
fails.
ok kurt@
|
|
ok miod@
|
|
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@
|
|
|
|
|
|
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@
|
|
|
|
architectures with variable page size.
|
|
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@
|
|
instead handle it internally as $ra
solution from kettenis, ok guenther
|
|
|
|
|
|
|
|
|
|
sure we move on to the next relocation entry.
While there, also skip relocations for REL architectures.
|
|
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@
|
|
|
|
special case; no binary change
ok kettenis@
|
|
ok miod@ deraadt@
|
|
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@
|
|
defined and we don't think ld.so has already done the TCB setup.
ok and much discussion miod@
|
|
the md_init.h files.
Worked out with and ok miod@; ok matthew@
|
|
ok guenther millert kettenis
|
|
GCC's documentation. Fixes GNU C++'s init_priority attribute.
ok miod
|
|
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.
|
|
bits of code and data. With this change gcc4 builds usable crt*.o on sparc64,
other architectures probably need some more love.
ok marco@, jsg@
|
|
32 bit ints on OpenBSD.
ok kettenis@
|
|
with minor differences.
okay kettenis@ drahn@
|
|
okay kettenis@ drahn@
|
|
ok kurt@, drahn@, miod@
|
|
object destructors called at dlclose() time. Inspired by similar changes in FreeBSD and NetBSD.
|
|
ok drahn@, pval@, deraadt@
|
|
ok drahn@, millert@
|
|
stop most kde apps from burping all over the place on exit, which
means that, somehow, our destructors get registered twice... :-(
Okay drahn@
|
|
ok drahn@, some time ago.
|
|
be a section which code stubs (branches) can be added to initialize/destructor
This adds MD stubs to allow this to operate as expected. should fix wine
and behave according to ELF specs. ok miod@
|
|
ok espie, millert
|
|
henric@ henning@ ok
|
|
|
|
is not newline terminated.
From Thorsten Glaser
|
|
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
|
|
versions of these files.
Fixed a bug in ld.so in this, instead of scheduling the fini of each of
the shared libraries with atexit. schedule a function of ld.so itself
and it will walk all of the open libraries when the program exits.
otherwise a shared library could be dl_open()ed and then dl_close()d
and then it would not be mapped for the atexit processing.
TODO:
What if atexit is not found (process did not link against libc?)
Do shared libraries that are dl_closed have their global destructors run?
|
|
|
|
|
|
|
|
This appears to be the standard way to do it.
|