Merge "linker: add test for empty shdr table"
am: ac69db1f85
Change-Id: Ib72a58f9f3e07cb136cdf01e2e073b389d77c62e
This commit is contained in:
commit
68418746f2
6 changed files with 11 additions and 0 deletions
|
@ -32,6 +32,9 @@ include $(LOCAL_PATH)/Android.build.prebuilt.mk
|
|||
bionic_tests_module := libtest_invalid-zero_shstrndx.so
|
||||
include $(LOCAL_PATH)/Android.build.prebuilt.mk
|
||||
|
||||
bionic_tests_module := libtest_invalid-empty_shdr_table.so
|
||||
include $(LOCAL_PATH)/Android.build.prebuilt.mk
|
||||
|
||||
ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
|
||||
build_host := true
|
||||
else
|
||||
|
|
|
@ -1186,4 +1186,12 @@ TEST(dlfcn, dlopen_invalid_zero_shstrndx) {
|
|||
ASSERT_STREQ(expected_dlerror.c_str(), dlerror());
|
||||
}
|
||||
|
||||
TEST(dlfcn, dlopen_invalid_empty_shdr_table) {
|
||||
std::string libpath = std::string(getenv("ANDROID_DATA")) + PREBUILT_ELF_PATH + "/libtest_invalid-empty_shdr_table.so";
|
||||
void* handle = dlopen(libpath.c_str(), RTLD_NOW);
|
||||
ASSERT_TRUE(handle == nullptr);
|
||||
std::string expected_dlerror = std::string("dlopen failed: \"") + libpath + "\" has no section headers";
|
||||
ASSERT_STREQ(expected_dlerror.c_str(), dlerror());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
BIN
tests/prebuilt-elf-files/arm/libtest_invalid-empty_shdr_table.so
Executable file
BIN
tests/prebuilt-elf-files/arm/libtest_invalid-empty_shdr_table.so
Executable file
Binary file not shown.
BIN
tests/prebuilt-elf-files/arm64/libtest_invalid-empty_shdr_table.so
Executable file
BIN
tests/prebuilt-elf-files/arm64/libtest_invalid-empty_shdr_table.so
Executable file
Binary file not shown.
BIN
tests/prebuilt-elf-files/x86/libtest_invalid-empty_shdr_table.so
Executable file
BIN
tests/prebuilt-elf-files/x86/libtest_invalid-empty_shdr_table.so
Executable file
Binary file not shown.
BIN
tests/prebuilt-elf-files/x86_64/libtest_invalid-empty_shdr_table.so
Executable file
BIN
tests/prebuilt-elf-files/x86_64/libtest_invalid-empty_shdr_table.so
Executable file
Binary file not shown.
Loading…
Reference in a new issue