Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/libexec/ld.elf_so check that dlopen()d dso shows up in...
details: https://anonhg.NetBSD.org/src/rev/841407bb9154
branches: trunk
changeset: 763566:841407bb9154
user: pooka <pooka%NetBSD.org@localhost>
date: Fri Mar 25 14:45:21 2011 +0000
description:
check that dlopen()d dso shows up in the linkmap
diffstat:
tests/libexec/ld.elf_so/t_dlinfo.c | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
diffs (45 lines):
diff -r 59b21d181084 -r 841407bb9154 tests/libexec/ld.elf_so/t_dlinfo.c
--- a/tests/libexec/ld.elf_so/t_dlinfo.c Fri Mar 25 10:42:38 2011 +0000
+++ b/tests/libexec/ld.elf_so/t_dlinfo.c Fri Mar 25 14:45:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_dlinfo.c,v 1.2 2010/11/03 16:10:23 christos Exp $ */
+/* $NetBSD: t_dlinfo.c,v 1.3 2011/03/25 14:45:21 pooka Exp $ */
/*
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -84,10 +84,35 @@
dlclose(handle);
}
+ATF_TC(rtld_dlinfo_linkmap_dlopen_iter);
+ATF_TC_HEAD(rtld_dlinfo_linkmap_dlopen_iter, tc)
+{
+ atf_tc_set_md_var(tc, "descr", "dlopen'd dso's show up in the list");
+}
+ATF_TC_BODY(rtld_dlinfo_linkmap_dlopen_iter, tc)
+{
+ struct link_map *map;
+ void *handle;
+
+ handle = dlopen("libutil.so", RTLD_LAZY);
+ ATF_CHECK(handle);
+
+ RZ(dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &map));
+
+ for (; map->l_next; map = map->l_next)
+ continue;
+ for (; map; map = map->l_prev)
+ if (strstr(map->l_name, "libutil.so") != NULL)
+ break;
+
+ ATF_REQUIRE_MSG(map, "dlopen()d object not found from linkmap");
+}
+
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, rtld_dlinfo_linkmap_self);
ATF_TP_ADD_TC(tp, rtld_dlinfo_linkmap_inval);
ATF_TP_ADD_TC(tp, rtld_dlinfo_linkmap_dlopen);
+ ATF_TP_ADD_TC(tp, rtld_dlinfo_linkmap_dlopen_iter);
return 0;
}
Home |
Main Index |
Thread Index |
Old Index