* Fix from Alfred to allow functioning on newer openbsd. fixes issue #41017

This commit is contained in:
Michaël Van Canneyt 2026-02-04 18:58:37 +01:00
parent 77dc8ef232
commit e3f9937cf9
2 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,14 @@
.ascii "OpenBSD\0"
.long 0
.previous
/* Define the DSO handle for C++ ABI compatibility.
This is required for exit() to work on OpenBSD. */
.globl __dso_handle
.hidden __dso_handle
__dso_handle:
.quad __dso_handle
.file "crt0.c"
.globl __progname
.section .rodata

View File

@ -16,6 +16,10 @@
{$asmmode gas}
{ External global handle defined in prt0.as }
var
__dso_handle: pointer; external name '__dso_handle';
procedure __init; cdecl; external name '__init';
procedure c_exit(exit_code: cint); cdecl; noreturn; external name 'exit';
function _csu_finish(_argv: PPAnsiChar; _envp: PPAnsiChar; _cleanup: TCdeclProcedure): PPPChar; cdecl; external name '_csu_finish';