History log of /openbsd-src/lib/csu/i386/md_init.h (Results 1 – 13 of 13)
Revision Date Author Comments
# 1e43641e 18-Nov-2023 deraadt <deraadt@openbsd.org>

crt0 uses a helper function in a MD src/libexec/ld.so .h file (rather than
reproducing the relevant defines and code in a different place) to perform
minor relocations. If things go very wrong, it w

crt0 uses a helper function in a MD src/libexec/ld.so .h file (rather than
reproducing the relevant defines and code in a different place) to perform
minor relocations. If things go very wrong, it would call _dl_exit() --
a locally defined crt0 function which is syscall exit(2). We don't need
to call exit(2) for this obscure case which doesn't happen and provides no
debugging information. An 'abort' is going to provide better information.
So let's change the function name to _dso_abort() and make it a single
illegal instruction.
ok guenther

show more ...


# ba1a662d 25-Apr-2023 deraadt <deraadt@openbsd.org>

placing .align after the function start is crazy. other things are ensuring
this function is at the start of the section, there is no poing in potentially
stuffing nops into the sequence if things g

placing .align after the function start is crazy. other things are ensuring
this function is at the start of the section, there is no poing in potentially
stuffing nops into the sequence if things go wrong, it is better to fail hard.
ok guenther

show more ...


# 2bc3a8c0 15-Oct-2020 deraadt <deraadt@openbsd.org>

crt0 MD _dl_exit() performs syscall to SYS_exit directly, but then
some of these functions were returning. That makes the +1word address
a fairly strong and easily located gadget. Put a hard-trap
i

crt0 MD _dl_exit() performs syscall to SYS_exit directly, but then
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

show more ...


# 9c558c11 14-Oct-2020 deraadt <deraadt@openbsd.org>

use symbolic SYS_exit instead of the value 1
ok kettenis


# 344baaa7 11-Aug-2017 guenther <guenther@openbsd.org>

_dl_printf is no longer referenced by RELOC_{JMPREL,DYN,GOT}; delete the stub

ok kettenis@


# 712997c7 07-Aug-2016 guenther <guenther@openbsd.org>

Teach i386 to pass &_DYNAMIC to _dl_boot_bind()


# 5af055cd 20-Mar-2016 guenther <guenther@openbsd.org>

Rearrange C runtime bits: now that ld.so exports environ and __progname,
move their definitions and initialization in static links to libc.a
Make crt0 always invoke a new func _csu_finish() in libc t

Rearrange C runtime bits: now that ld.so exports environ and __progname,
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@

show more ...


# 0a8a9c34 01-Sep-2015 guenther <guenther@openbsd.org>

In static binaries, invoke kbind() once to disable it.

With much assistance from miod@
ok deraadt@@


# f67a8cac 22-Dec-2014 kurt <kurt@openbsd.org>

Self-relocation code for i386.


# 453b49cd 03-Dec-2013 guenther <guenther@openbsd.org>

Merge the per-arch crt0.c files into common_elf/crt0.c, with MD macros in
the md_init.h files.

Worked out with and ok miod@; ok matthew@


# 9c1165c0 23-Dec-2012 kettenis <kettenis@openbsd.org>

Explicitly align the stack on a 16-byte boundary such that constructors can
use SSE instructions. In principle we should be able to rely on the stack to
be aligned properly, but the i386 calling con

Explicitly align the stack on a 16-byte boundary such that constructors can
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@

show more ...


# 6fa7743b 31-Mar-2011 kettenis <kettenis@openbsd.org>

Make sure everything run from .init and .fini sections gets a properly aligned
stack.

ok fgsch@


# 8d0ba7c9 08-Jan-2004 drahn <drahn@openbsd.org>

__init/__fini handling on ELF has not been correct. It is supposed to
be a section which code stubs (branches) can be added to initialize/destructor
This adds MD stubs to allow this to operate as exp

__init/__fini handling on ELF has not been correct. It is supposed to
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@

show more ...