summaryrefslogtreecommitdiff
path: root/elf/tst-dlmopen-rtld-unique6.h
diff options
context:
space:
mode:
authorVivek Das Mohapatra <vivek@collabora.com>2021-08-03 10:24:47 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-09-27 13:58:32 -0300
commit9b9601a00f380658d507b3d4a32f60984ffd092d (patch)
tree1b52e50eb418ef119803b880ddc992c695ad7b2b /elf/tst-dlmopen-rtld-unique6.h
parent010fc01f004241b6afcae92f2d20fe47e6869f72 (diff)
downloadglibc-9b9601a00f380658d507b3d4a32f60984ffd092d.tar.gz
elf: Add dlmopen / RTLD_SHARED testsazanella/rtld-shared
We ensure a DF_GNU_1_UNIQUE library is loaded (as a DT_NEEDED dependency) into the target namespace by the test module. This checks that the code path for dependencies honours the flag and prepares a base namespace library with a proxy in the target namespace (since the mechanism for this is not the same as for DSOs that have already been loaded into the base namespace). Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'elf/tst-dlmopen-rtld-unique6.h')
-rw-r--r--elf/tst-dlmopen-rtld-unique6.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/elf/tst-dlmopen-rtld-unique6.h b/elf/tst-dlmopen-rtld-unique6.h
new file mode 100644
index 0000000000..062f1f2277
--- /dev/null
+++ b/elf/tst-dlmopen-rtld-unique6.h
@@ -0,0 +1,51 @@
+static dlmopen_test_spec dltest[] =
+ {
+ {
+ .name = "dlmopen-isolate-unique:1:none--ns1--prep",
+ .desc = "dlmopen a DF_GNU_1_UNIQUE dso into NS1 with RTLD_ISOLATE",
+ .is_prep_stage = 1,
+ .args.dso_path = DSO_UNIQUE,
+ .args.ns = LM_ID_NEWLM,
+ .args.flags = RTLD_ISOLATE,
+ .handle_ns = EXPECTED_NS,
+ .free_ns = EXPECTED_NS,
+ .handle_type = DSO,
+ .preloaded = { },
+ .loaded = { [EXPECTED_NS] = DSO|NEW },
+ },
+ {
+ .name = "dlmopen-unique:1:nsX--nsX--FAIL",
+ .desc = "dlmopen a DF_GNU_1_UNIQUE dso into NSX when already there",
+ .args.dso_path = DSO_UNIQUE,
+ .args.ns = EXPECTED_NS,
+ .failure = 1,
+ .preloaded = { [EXPECTED_NS] = DSO },
+ },
+ {
+ .name = "dlmopen-shared-unique:X:nsX--nsX--FAIL",
+ .desc = "dlmopen RTLD_SHARED a DF_GNU_1_UNIQUE dso into NSX when already there",
+ .args.dso_path = DSO_UNIQUE,
+ .args.ns = EXPECTED_NS,
+ .args.flags = RTLD_SHARED,
+ .failure = 1,
+ .preloaded = { [EXPECTED_NS] = DSO },
+ },
+ {
+ .name = "dlmopen-shared-unique:0:nsX--ns0-nsX",
+ .desc = "dlmopen RTLD_SHARED a DF_GNU_1_UNIQUE dso already present in NS X",
+ .args.dso_path = DSO_UNIQUE,
+ .args.ns = LM_ID_BASE,
+ .handle_ns = 0,
+ .handle_type = DSO,
+ .preloaded = { [EXPECTED_NS] = DSO },
+ .loaded = { [0] = DSO|NEW, [EXPECTED_NS] = DSO },
+ },
+ {
+ .name = "dlmopen-shared-unique:X:ns0-nsX--ns0-nsX--FAIL",
+ .desc = "dlmopen RTLD_SHARED a DF_GNU_1_UNIQUE dso already in the base NS and NS 1",
+ .args.dso_path = DSO_UNIQUE,
+ .args.ns = EXPECTED_NS,
+ .failure = 1,
+ .preloaded = { [0] = DSO, [EXPECTED_NS] = DSO },
+ },
+ };