__cxa_thread_atexit() implementation.
ok guenther@
-/* $OpenBSD: dlfcn.h,v 1.13 2013/03/24 01:37:21 deraadt Exp $ */
+/* $OpenBSD: dlfcn.h,v 1.14 2017/11/28 17:19:47 kettenis Exp $ */
/* $NetBSD: dlfcn.h,v 1.2 1995/06/05 19:38:00 pk Exp $ */
/*
#define DL_GETLOADADDR x
#define DL_SETTHREADLCK 2
#define DL_SETBINDLCK 3
+#define DL_REFERENCE 4
#define DL_LAZY RTLD_LAZY /* Compat */
-/* $OpenBSD: dlfcn.c,v 1.98 2017/08/29 15:25:51 deraadt Exp $ */
+/* $OpenBSD: dlfcn.c,v 1.99 2017/11/28 17:19:47 kettenis Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
/* made superfluous by kbind */
retval = 0;
break;
+ case DL_REFERENCE:
+ {
+ elf_object_t *obj;
+
+ obj = obj_from_addr(data);
+ if (obj == NULL) {
+ _dl_errno = DL_CANT_FIND_OBJ;
+ retval = -1;
+ break;
+ }
+ if ((obj->status & STAT_NODELETE) == 0) {
+ obj->opencount++;
+ obj->status |= STAT_NODELETE;
+ }
+ retval = 0;
+ break;
+ }
case 0x20:
_dl_show_objects();
retval = 0;