Merge "linker: add test for zeroed out shdr_table_"
This commit is contained in:
commit
3b2d331e77
6 changed files with 11 additions and 0 deletions
|
@ -38,6 +38,9 @@ include $(LOCAL_PATH)/Android.build.prebuilt.mk
|
|||
bionic_tests_module := libtest_invalid-zero_shdr_table_offset.so
|
||||
include $(LOCAL_PATH)/Android.build.prebuilt.mk
|
||||
|
||||
bionic_tests_module := libtest_invalid-zero_shdr_table_content.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
|
||||
|
|
|
@ -1202,4 +1202,12 @@ TEST(dlfcn, dlopen_invalid_zero_shdr_table_offset) {
|
|||
ASSERT_SUBSTR(expected_dlerror.c_str(), dlerror());
|
||||
}
|
||||
|
||||
TEST(dlfcn, dlopen_invalid_zero_shdr_table_content) {
|
||||
std::string libpath = std::string(getenv("ANDROID_DATA")) + PREBUILT_ELF_PATH + "/libtest_invalid-zero_shdr_table_content.so";
|
||||
void* handle = dlopen(libpath.c_str(), RTLD_NOW);
|
||||
ASSERT_TRUE(handle == nullptr);
|
||||
std::string expected_dlerror = std::string("dlopen failed: \"") + libpath + "\" .dynamic section header was not found";
|
||||
ASSERT_SUBSTR(expected_dlerror.c_str(), dlerror());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
BIN
tests/prebuilt-elf-files/arm/libtest_invalid-zero_shdr_table_content.so
Executable file
BIN
tests/prebuilt-elf-files/arm/libtest_invalid-zero_shdr_table_content.so
Executable file
Binary file not shown.
BIN
tests/prebuilt-elf-files/arm64/libtest_invalid-zero_shdr_table_content.so
Executable file
BIN
tests/prebuilt-elf-files/arm64/libtest_invalid-zero_shdr_table_content.so
Executable file
Binary file not shown.
BIN
tests/prebuilt-elf-files/x86/libtest_invalid-zero_shdr_table_content.so
Executable file
BIN
tests/prebuilt-elf-files/x86/libtest_invalid-zero_shdr_table_content.so
Executable file
Binary file not shown.
BIN
tests/prebuilt-elf-files/x86_64/libtest_invalid-zero_shdr_table_content.so
Executable file
BIN
tests/prebuilt-elf-files/x86_64/libtest_invalid-zero_shdr_table_content.so
Executable file
Binary file not shown.
Loading…
Reference in a new issue