From bc75047a1b0e68006077ea2e5f798475c90cbad0 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Fri, 30 Oct 2015 17:43:27 -0700 Subject: [PATCH] Generate libdl.so per-architecture version script Bug: http://b/24767418 Change-Id: I3d5775ba44d4c8e7fc5f2fbebae10e022100f1e2 --- libc/tools/genversion-scripts.py | 4 +++- libdl/Android.mk | 9 ++++++++- libdl/libdl.arm.map | 23 +++++++++++++++++++++++ libdl/libdl.arm64.map | 22 ++++++++++++++++++++++ libdl/{libdl.map => libdl.map.txt} | 4 +--- libdl/libdl.mips.map | 22 ++++++++++++++++++++++ libdl/libdl.mips64.map | 22 ++++++++++++++++++++++ libdl/libdl.x86.map | 22 ++++++++++++++++++++++ libdl/libdl.x86_64.map | 22 ++++++++++++++++++++++ 9 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 libdl/libdl.arm.map create mode 100644 libdl/libdl.arm64.map rename libdl/{libdl.map => libdl.map.txt} (94%) create mode 100644 libdl/libdl.mips.map create mode 100644 libdl/libdl.mips64.map create mode 100644 libdl/libdl.x86.map create mode 100644 libdl/libdl.x86_64.map diff --git a/libc/tools/genversion-scripts.py b/libc/tools/genversion-scripts.py index 73faf2a8b..37fb5e928 100755 --- a/libc/tools/genversion-scripts.py +++ b/libc/tools/genversion-scripts.py @@ -12,8 +12,10 @@ import tempfile all_arches = ["arm", "arm64", "mips", "mips64", "x86", "x86_64"] bionic_libc_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libc") bionic_libm_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libm") +bionic_libdl_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libdl") libc_script = os.path.join(bionic_libc_root, "libc.map.txt") libm_script = os.path.join(bionic_libm_root, "libm.map.txt") +libdl_script = os.path.join(bionic_libdl_root, "libdl.map.txt") # TODO (dimity): generate architecture-specific version scripts as part of build @@ -30,7 +32,7 @@ warning = "Generated by genversionscripts.py. Do not edit." class VersionScriptGenerator(object): def run(self): - for script in [libc_script, libm_script]: + for script in [libc_script, libm_script, libdl_script]: basename = os.path.basename(script) dirname = os.path.dirname(script) for arch in all_arches: diff --git a/libdl/Android.mk b/libdl/Android.mk index 4ab32e037..9a9c75606 100644 --- a/libdl/Android.mk +++ b/libdl/Android.mk @@ -15,12 +15,19 @@ include $(CLEAR_VARS) # # DO NOT REMOVE --exclude-libs! -LOCAL_LDFLAGS := -Wl,--exclude-libs=libgcc.a -Wl,--version-script=$(LOCAL_PATH)/libdl.map +LOCAL_LDFLAGS := -Wl,--exclude-libs=libgcc.a # for x86, exclude libgcc_eh.a for the same reasons as above LOCAL_LDFLAGS_x86 := -Wl,--exclude-libs=libgcc_eh.a LOCAL_LDFLAGS_x86_64 := $(LOCAL_LDFLAGS_x86) +LOCAL_LDFLAGS_arm += -Wl,--version-script=$(LOCAL_PATH)/libdl.arm.map +LOCAL_LDFLAGS_arm64 += -Wl,--version-script=$(LOCAL_PATH)/libdl.arm64.map +LOCAL_LDFLAGS_mips += -Wl,--version-script=$(LOCAL_PATH)/libdl.mips.map +LOCAL_LDFLAGS_mips64 += -Wl,--version-script=$(LOCAL_PATH)/libdl.mips64.map +LOCAL_LDFLAGS_x86 += -Wl,--version-script=$(LOCAL_PATH)/libdl.x86.map +LOCAL_LDFLAGS_x86_64 += -Wl,--version-script=$(LOCAL_PATH)/libdl.x86_64.map + LOCAL_SRC_FILES:= libdl.c LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror LOCAL_CXX_STL := none diff --git a/libdl/libdl.arm.map b/libdl/libdl.arm.map new file mode 100644 index 000000000..9e5870416 --- /dev/null +++ b/libdl/libdl.arm.map @@ -0,0 +1,23 @@ +# Generated by genversionscripts.py. Do not edit. + +LIBC { + global: + android_dlopen_ext; + dl_iterate_phdr; + dl_unwind_find_exidx; # arm + dladdr; + dlclose; + dlerror; + dlopen; + dlsym; + local: + *; +}; + +LIBC_PRIVATE { + global: + android_get_application_target_sdk_version; + android_set_application_target_sdk_version; + android_get_LD_LIBRARY_PATH; + android_update_LD_LIBRARY_PATH; +} LIBC; diff --git a/libdl/libdl.arm64.map b/libdl/libdl.arm64.map new file mode 100644 index 000000000..e83b501f1 --- /dev/null +++ b/libdl/libdl.arm64.map @@ -0,0 +1,22 @@ +# Generated by genversionscripts.py. Do not edit. + +LIBC { + global: + android_dlopen_ext; + dl_iterate_phdr; + dladdr; + dlclose; + dlerror; + dlopen; + dlsym; + local: + *; +}; + +LIBC_PRIVATE { + global: + android_get_application_target_sdk_version; + android_set_application_target_sdk_version; + android_get_LD_LIBRARY_PATH; + android_update_LD_LIBRARY_PATH; +} LIBC; diff --git a/libdl/libdl.map b/libdl/libdl.map.txt similarity index 94% rename from libdl/libdl.map rename to libdl/libdl.map.txt index a911cb67a..f71f40b77 100644 --- a/libdl/libdl.map +++ b/libdl/libdl.map.txt @@ -18,9 +18,7 @@ LIBC { global: android_dlopen_ext; dl_iterate_phdr; -# begin arm-only - dl_unwind_find_exidx; -# end arm-only + dl_unwind_find_exidx; # arm dladdr; dlclose; dlerror; diff --git a/libdl/libdl.mips.map b/libdl/libdl.mips.map new file mode 100644 index 000000000..e83b501f1 --- /dev/null +++ b/libdl/libdl.mips.map @@ -0,0 +1,22 @@ +# Generated by genversionscripts.py. Do not edit. + +LIBC { + global: + android_dlopen_ext; + dl_iterate_phdr; + dladdr; + dlclose; + dlerror; + dlopen; + dlsym; + local: + *; +}; + +LIBC_PRIVATE { + global: + android_get_application_target_sdk_version; + android_set_application_target_sdk_version; + android_get_LD_LIBRARY_PATH; + android_update_LD_LIBRARY_PATH; +} LIBC; diff --git a/libdl/libdl.mips64.map b/libdl/libdl.mips64.map new file mode 100644 index 000000000..e83b501f1 --- /dev/null +++ b/libdl/libdl.mips64.map @@ -0,0 +1,22 @@ +# Generated by genversionscripts.py. Do not edit. + +LIBC { + global: + android_dlopen_ext; + dl_iterate_phdr; + dladdr; + dlclose; + dlerror; + dlopen; + dlsym; + local: + *; +}; + +LIBC_PRIVATE { + global: + android_get_application_target_sdk_version; + android_set_application_target_sdk_version; + android_get_LD_LIBRARY_PATH; + android_update_LD_LIBRARY_PATH; +} LIBC; diff --git a/libdl/libdl.x86.map b/libdl/libdl.x86.map new file mode 100644 index 000000000..e83b501f1 --- /dev/null +++ b/libdl/libdl.x86.map @@ -0,0 +1,22 @@ +# Generated by genversionscripts.py. Do not edit. + +LIBC { + global: + android_dlopen_ext; + dl_iterate_phdr; + dladdr; + dlclose; + dlerror; + dlopen; + dlsym; + local: + *; +}; + +LIBC_PRIVATE { + global: + android_get_application_target_sdk_version; + android_set_application_target_sdk_version; + android_get_LD_LIBRARY_PATH; + android_update_LD_LIBRARY_PATH; +} LIBC; diff --git a/libdl/libdl.x86_64.map b/libdl/libdl.x86_64.map new file mode 100644 index 000000000..e83b501f1 --- /dev/null +++ b/libdl/libdl.x86_64.map @@ -0,0 +1,22 @@ +# Generated by genversionscripts.py. Do not edit. + +LIBC { + global: + android_dlopen_ext; + dl_iterate_phdr; + dladdr; + dlclose; + dlerror; + dlopen; + dlsym; + local: + *; +}; + +LIBC_PRIVATE { + global: + android_get_application_target_sdk_version; + android_set_application_target_sdk_version; + android_get_LD_LIBRARY_PATH; + android_update_LD_LIBRARY_PATH; +} LIBC;