Add invalid riscv64 ELF files for the linker tests.
The libtest_empty.so was built by the "libtest_empty" build rule, and
the other files are copies of that with small edits made by the toybox
hexedit tool. I worked out what to edit in each case from a combination
of "what does the name imply?" and "what does a diff of the xxd output
of the corresponding two arm64 files show?".
I failed to produce a working (by which I mean "failing") local-tls
file despite my best efforts. I'm not sure what exactly it was about the
gold-generated files we didn't like, because the commentary implies that
this would be problematic:
39: 0000000000000004 4 TLS LOCAL DEFAULT 12 tls_var_2
But it loads without complaint.
Test: ran locally
Change-Id: I3b9b2b4db1f8827243541cf13380c6ceb840f123
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index c5d1218..939c092 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -1646,6 +1646,9 @@
}
TEST(dlfcn, dlopen_invalid_local_tls) {
+#if defined(__riscv)
+ // This is a test for bad gold behavior, and gold doesn't support riscv64.
+#else
const std::string libpath = GetPrebuiltElfDir() + "/libtest_invalid-local-tls.so";
void* handle = dlopen(libpath.c_str(), RTLD_NOW);
@@ -1658,6 +1661,7 @@
std::string expected_dlerror = std::string("dlopen failed: unexpected TLS reference to ") +
referent + " in \"" + libpath + "\"";
ASSERT_SUBSTR(expected_dlerror.c_str(), dlerror());
+#endif
}
TEST(dlfcn, dlopen_df_1_global) {