Use hidden aliases for internal invocations of exported symbols to avoid PLT.
ok deraadt@ kettenis@ jca@
-# $OpenBSD: Makefile,v 1.18 2016/03/30 06:38:42 jmc Exp $
+# $OpenBSD: Makefile,v 1.19 2017/12/14 17:06:33 guenther Exp $
# $NetBSD: Makefile,v 1.11 1996/03/18 22:33:07 thorpej Exp $
# from: @(#)Makefile 8.1 (Berkeley) 6/4/93
.endif
.endif
+VERSION_SCRIPT= ${.CURDIR}/Symbols.map
+
CFLAGS+= -D_LIBKVM
SRCS+= kvm.c kvm_file2.c kvm_getloadavg.c kvm_proc.c kvm_proc2.c \
kvm_cd9660.c kvm_udf.c kvm_ntfs.c
--- /dev/null
+{
+ global:
+ kvm_close;
+ kvm_dump_inval;
+ kvm_dump_mkheader;
+ kvm_dump_wrtheader;
+ kvm_getargv;
+ kvm_getenvv;
+ kvm_geterr;
+ kvm_getfiles;
+ kvm_getloadavg;
+ kvm_getprocs;
+ kvm_nlist;
+ kvm_open;
+ kvm_openfiles;
+ kvm_read;
+ kvm_write;
+
+ local:
+ *;
+};
-/* $OpenBSD: kvm.c,v 1.62 2016/07/10 23:06:48 tedu Exp $ */
+/* $OpenBSD: kvm.c,v 1.63 2017/12/14 17:06:33 guenther Exp $ */
/* $NetBSD: kvm.c,v 1.43 1996/05/05 04:31:59 gwr Exp $ */
/*-
return (error);
}
+DEF(kvm_close);
/*
* Set up state necessary to do queries on the kernel namelist
*/
return ((p - nl) - nvalid);
}
+DEF(kvm_nlist);
int
kvm_dump_inval(kvm_t *kd)
}
/* NOTREACHED */
}
+DEF(kvm_read);
ssize_t
kvm_write(kvm_t *kd, u_long kva, const void *buf, size_t len)
-/* $OpenBSD: kvm_private.h,v 1.24 2015/09/04 02:55:09 dlg Exp $ */
+/* $OpenBSD: kvm_private.h,v 1.25 2017/12/14 17:06:33 guenther Exp $ */
/* $NetBSD: kvm_private.h,v 1.7 1996/05/05 04:32:15 gwr Exp $ */
/*-
ssize_t _kvm_pread(kvm_t *, int, void *, size_t, off_t);
ssize_t _kvm_pwrite(kvm_t *, int, const void *, size_t, off_t);
__END_HIDDEN_DECLS
+
+
+#define PROTO(x) __dso_hidden typeof(x) x asm("__"#x)
+#define DEF(x) __strong_alias(x, __##x)
+
+PROTO(kvm_close);
+PROTO(kvm_nlist);
+PROTO(kvm_read);
-major=16
-minor=2
+major=17
+minor=0