summaryrefslogtreecommitdiff
path: root/tests/dlext_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dlext_test.cpp')
-rw-r--r--tests/dlext_test.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index 67ebf37df..e7274f704 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -29,9 +29,7 @@
#include <android-base/file.h>
#include <android-base/strings.h>
-#include <linux/memfd.h>
#include <sys/mman.h>
-#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/vfs.h>
#include <sys/wait.h>
@@ -363,8 +361,10 @@ TEST_F(DlExtTest, ReservedRecursive) {
uint32_t* taxicab_number = reinterpret_cast<uint32_t*>(dlsym(handle_, "dlopen_testlib_taxicab_number"));
ASSERT_DL_NOTNULL(taxicab_number);
- EXPECT_GE(reinterpret_cast<void*>(taxicab_number), start);
- EXPECT_LT(reinterpret_cast<void*>(taxicab_number), reinterpret_cast<char*>(start) + kLibSize);
+ // Untag the pointer so that it can be compared with start, which will be untagged.
+ void* addr = reinterpret_cast<void*>(untag_address(taxicab_number));
+ EXPECT_GE(addr, start);
+ EXPECT_LT(addr, reinterpret_cast<char*>(start) + kLibSize);
EXPECT_EQ(1729U, *taxicab_number);
}
@@ -942,7 +942,7 @@ TEST(dlext, dlopen_ext_use_memfd) {
const std::string lib_path = GetTestlibRoot() + "/libtest_simple.so";
// create memfd
- int memfd = syscall(__NR_memfd_create, "foobar", MFD_CLOEXEC);
+ int memfd = memfd_create("foobar", MFD_CLOEXEC);
if (memfd == -1 && errno == ENOSYS) {
return;
}