History log of /openbsd-src/lib/csu/arm/md_init.h (Results 1 – 19 of 19)
Revision Date Author Comments
# 792c719e 17-Aug-2024 phessler <phessler@openbsd.org>

effectively revert revision 1.7.

The original reason was some corner cases around COPY relocations, which
caused problems for miniperl which directly modified environ and accessed
environ via libc f

effectively revert revision 1.7.

The original reason was some corner cases around COPY relocations, which
caused problems for miniperl which directly modified environ and accessed
environ via libc functions.

This causes duplicate symbols for environ/__progname in some (poorly written)
apps, but is allowed on most other architectures.

Since the time this was added other arm architecture changes mean that we
don't need it, so remove it.

debugged with kettenis@ and jca@
tested and OK guenther@

show more ...


# 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 ...


# 5bbf8832 19-Oct-2020 naddy <naddy@openbsd.org>

replace ad-hoc illegal instruction with the architecturally defined one
("permanently undefined")
ok deraadt@ kettenis@


# 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


# f74a2b77 13-Mar-2020 deraadt <deraadt@openbsd.org>

Anthony Steinhauser reports that 32-bit arm cpus have the same speculation
problems as 64-bit models. To resolve the syscall speculation, as a first
step "nop; nop" was added after all occurances of

Anthony Steinhauser reports that 32-bit arm cpus have the same speculation
problems as 64-bit models. To resolve the syscall speculation, as a first
step "nop; nop" was added after all occurances of the syscall ("swi 0")
instruction. Then the kernel was changed to jump over the 2 extra instructions.
In this final step, those pair of nops are converted into the speculation-blocking
sequence ("dsb nsh; isb").
Don't try to build through these multiple steps, use a snapshot instead.
Packages matching the new ABI will be out in a while...
ok kettenis

show more ...


# afaa629c 11-Mar-2020 deraadt <deraadt@openbsd.org>

Anthony Steinhauser reports that 32-bit arm cpus have the same speculation
problems as 64-bit models. For the syscall instruction issue, add nop;nop
after swi 0, in preparation for jumping over a sp

Anthony Steinhauser reports that 32-bit arm cpus have the same speculation
problems as 64-bit models. For the syscall instruction issue, add nop;nop
after swi 0, in preparation for jumping over a speculation barrier here later.

show more ...


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

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

ok kettenis@


# 08c612f1 26-Feb-2017 kettenis <kettenis@openbsd.org>

Use a long branch (using movw/movt) to implement MD_SECT_CALL_FUNC.
Necessary (but perhaps not suffcient) to build large binaries on arm.

ok guenther@


# b3fe29f4 21-Jan-2017 guenther <guenther@openbsd.org>

Declare the symbols that label the .ctors, .dtors, .eh_frame, and .jcr
sections as extern hidden arrays of indefinite size, so that the compiler
(well, clang) doesn't believe it knows the exact conte

Declare the symbols that label the .ctors, .dtors, .eh_frame, and .jcr
sections as extern hidden arrays of indefinite size, so that the compiler
(well, clang) doesn't believe it knows the exact contents and thus optimize
things into infinite loops. Actually set the symbols to be in the sections
and insert the leading and trailing values via __asm().

Problem pointed out by patrick@
testing and ok kettenis@

show more ...


# 306c523a 03-Oct-2016 kettenis <kettenis@openbsd.org>

Simplify code that sets up a stack frame for running .init code to be more
AEABI-like.

ok tom@, jsg@


# dfd75ee2 08-Sep-2016 kettenis <kettenis@openbsd.org>

Implement self-relocation for -static -pie on arm. Also removes some
unecessary code from the normal startup code and do some general cleanup to
make the code more readable.

ok guenther@, jsg@


# 8b713dc6 24-Mar-2016 guenther <guenther@openbsd.org>

Unbreak arm and m88k: COPY relocations for weak symbols that are overloaded
with strong symbols in ld.so don't do what we need, so put definitions back
in crt0 and make ld.so update __progname like i

Unbreak arm and m88k: COPY relocations for weak symbols that are overloaded
with strong symbols in ld.so don't do what we need, so put definitions back
in crt0 and make ld.so update __progname like it does environ.

report and testing patrick@ jsg@

show more ...


# 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@@


# 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@


# 32b97ded 22-Aug-2012 pascal <pascal@openbsd.org>

Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure cc
invocations. This allows us to use the compiler builtin define __PIC__ to check
for PIC/PIEness rather than passing -DPI

Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure cc
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@

show more ...


# 8409f467 09-Feb-2004 drahn <drahn@openbsd.org>

Proper PIC support in arm startup files.


# bd6cd6b0 01-Feb-2004 drahn <drahn@openbsd.org>

startup files for arm. Partially borrowed from NetBSD.