unloadable libraries. This allows us make consider making parts of those
libraries immutable (in future commits)
ok guenther kettenis
-/* $OpenBSD: loader.c,v 1.196 2022/10/28 15:07:25 kettenis Exp $ */
+/* $OpenBSD: loader.c,v 1.197 2022/11/06 11:34:50 deraadt Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
/* propagate DF_1_NOW to deplibs (can be set by dynamic tags) */
depflags = flags | (dynobj->obj_flags & DF_1_NOW);
+ /* Startup libraries are never unmapped and can be immutable */
+ if (booting)
+ depflags |= DF_1_NODELETE;
+
for (dynp = dynobj->load_dyn; dynp->d_tag; dynp++) {
if (dynp->d_tag == DT_NEEDED) {
libcount++;