From 1eca10fa9d3bce9a62ae882c995052974db7b3c3 Mon Sep 17 00:00:00 2001 From: Dimitry Ivanov Date: Thu, 23 Apr 2015 04:22:33 +0000 Subject: [PATCH] Revert "Pack relocation tables for all dynamic executables" This reverts commit e7a1b8a0c6d5f56e415345a0aceef3afe5ff5eff. Change-Id: I1a2185e1c68d364941e3b3e525a8c4a7a42e0cc1 --- core/clear_vars.mk | 1 - core/combo/TARGET_linux-arm.mk | 2 ++ core/combo/TARGET_linux-arm64.mk | 2 ++ core/combo/TARGET_linux-mips.mk | 2 ++ core/combo/TARGET_linux-mips64.mk | 2 ++ core/combo/TARGET_linux-x86.mk | 2 ++ core/combo/TARGET_linux-x86_64.mk | 2 ++ core/config.mk | 4 ---- core/definitions.mk | 9 -------- core/dynamic_binary.mk | 34 +++---------------------------- 10 files changed, 15 insertions(+), 45 deletions(-) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 6bc3632483..8bf4c57976 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -93,7 +93,6 @@ LOCAL_COPY_HEADERS:= LOCAL_FORCE_STATIC_EXECUTABLE:= LOCAL_ADDITIONAL_DEPENDENCIES:= LOCAL_STRIP_MODULE:= -LOCAL_PACK_MODULE_RELOCATIONS:= LOCAL_JNI_SHARED_LIBRARIES:= LOCAL_JNI_SHARED_LIBRARIES_ABI:= LOCAL_PREBUILT_JNI_LIBS:= diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk index 45f1f02820..8059b2adee 100644 --- a/core/combo/TARGET_linux-arm.mk +++ b/core/combo/TARGET_linux-arm.mk @@ -188,6 +188,8 @@ $(combo_2nd_arch_prefix)TARGET_CRTEND_O := $($(combo_2nd_arch_prefix)TARGET_OUT_ $(combo_2nd_arch_prefix)TARGET_CRTBEGIN_SO_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o $(combo_2nd_arch_prefix)TARGET_CRTEND_SO_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o +$(combo_2nd_arch_prefix)TARGET_STRIP_MODULE:=true + $(combo_2nd_arch_prefix)TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libm $(combo_2nd_arch_prefix)TARGET_LINKER := /system/bin/linker diff --git a/core/combo/TARGET_linux-arm64.mk b/core/combo/TARGET_linux-arm64.mk index 433e84f831..07a1de9b96 100644 --- a/core/combo/TARGET_linux-arm64.mk +++ b/core/combo/TARGET_linux-arm64.mk @@ -158,6 +158,8 @@ TARGET_CRTEND_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o TARGET_CRTEND_SO_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o +TARGET_STRIP_MODULE:=true + TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libm TARGET_LINKER := /system/bin/linker64 diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk index b17d59ab20..55566ebefb 100644 --- a/core/combo/TARGET_linux-mips.mk +++ b/core/combo/TARGET_linux-mips.mk @@ -162,6 +162,8 @@ $(combo_2nd_arch_prefix)TARGET_CRTEND_O := $($(combo_2nd_arch_prefix)TARGET_OUT_ $(combo_2nd_arch_prefix)TARGET_CRTBEGIN_SO_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o $(combo_2nd_arch_prefix)TARGET_CRTEND_SO_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o +$(combo_2nd_arch_prefix)TARGET_STRIP_MODULE:=true + $(combo_2nd_arch_prefix)TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libm $(combo_2nd_arch_prefix)TARGET_LINKER := /system/bin/linker diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk index 82ce11d989..c6f9f29b29 100644 --- a/core/combo/TARGET_linux-mips64.mk +++ b/core/combo/TARGET_linux-mips64.mk @@ -169,6 +169,8 @@ TARGET_CRTEND_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o TARGET_CRTEND_SO_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o +TARGET_STRIP_MODULE:=true + TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm TARGET_LINKER := /system/bin/linker64 diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk index 8d73fee9f6..f17a514fa3 100644 --- a/core/combo/TARGET_linux-x86.mk +++ b/core/combo/TARGET_linux-x86.mk @@ -142,6 +142,8 @@ $(combo_2nd_arch_prefix)TARGET_CRTEND_O := $($(combo_2nd_arch_prefix)TARGET_OUT_ $(combo_2nd_arch_prefix)TARGET_CRTBEGIN_SO_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o $(combo_2nd_arch_prefix)TARGET_CRTEND_SO_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o +$(combo_2nd_arch_prefix)TARGET_STRIP_MODULE:=true + $(combo_2nd_arch_prefix)TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libm $(combo_2nd_arch_prefix)TARGET_LINKER := /system/bin/linker diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk index 0b2905c9cb..2adb157ef0 100644 --- a/core/combo/TARGET_linux-x86_64.mk +++ b/core/combo/TARGET_linux-x86_64.mk @@ -151,6 +151,8 @@ TARGET_CRTEND_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o TARGET_CRTEND_SO_O := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o +TARGET_STRIP_MODULE:=true + TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libm TARGET_LINKER := /system/bin/linker64 diff --git a/core/config.mk b/core/config.mk index 83295d9be1..60ea592b84 100644 --- a/core/config.mk +++ b/core/config.mk @@ -425,10 +425,6 @@ ACP := $(BUILD_OUT_EXECUTABLES)/acp$(BUILD_EXECUTABLE_SUFFIX) # dx is java behind a shell script; no .exe necessary. DX := $(HOST_OUT_EXECUTABLES)/dx ZIPALIGN := $(HOST_OUT_EXECUTABLES)/zipalign$(HOST_EXECUTABLE_SUFFIX) - -# relocation packer -RELOCATION_PACKER := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/relocation_packer/relocation_packer - FINDBUGS_DIR := external/owasp/sanitizer/tools/findbugs/bin FINDBUGS := $(FINDBUGS_DIR)/findbugs EMMA_JAR := external/emma/lib/emma$(COMMON_JAVA_PACKAGE_SUFFIX) diff --git a/core/definitions.mk b/core/definitions.mk index b6e5277f43..8087f79683 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1452,15 +1452,6 @@ $(hide) $(PRIVATE_OBJCOPY) \ $(TARGET_STRIP_KEEP_SYMBOLS_EXTRA) $< $@ endef -########################################################### -## Commands for packing a target executable or library -########################################################### - -define pack-elf-relocations -$(copy-file-to-target) -@echo "target Pack Relocations: $(PRIVATE_MODULE) ($@)" -$(hide) $(RELOCATION_PACKER) $@ -endef ########################################################### ## Commands for running gcc to link an executable diff --git a/core/dynamic_binary.mk b/core/dynamic_binary.mk index afc6a1f8d8..7a423db432 100644 --- a/core/dynamic_binary.mk +++ b/core/dynamic_binary.mk @@ -57,11 +57,11 @@ $(symbolic_output) : $(symbolic_input) | $(ACP) ## Strip ########################################################### strip_input := $(symbolic_output) -strip_output := $(intermediates)/STRIPPED/$(my_built_module_stem) +strip_output := $(LOCAL_BUILT_MODULE) my_strip_module := $(LOCAL_STRIP_MODULE) ifeq ($(my_strip_module),) - my_strip_module := true + my_strip_module := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP_MODULE) endif $(strip_output): PRIVATE_STRIP := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) @@ -107,35 +107,7 @@ $(strip_output): $(strip_input) endif endif # my_strip_module -########################################################### -## Pack relocation tables -########################################################### -relocation_packer_input := $(strip_output) -relocation_packer_output := $(LOCAL_BUILT_MODULE) - -my_pack_module_relocations := $(LOCAL_PACK_MODULE_RELOCATIONS) - -# Do not pack relocations for static executables. -ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true) - my_pack_module_relocations := false -endif - -# TODO (dimitry): Relocation packer is not yet available for darwin -ifneq ($(HOST_OS),linux) - my_pack_module_relocations := false -endif - -ifneq (false,$(my_pack_module_relocations)) -# Pack relocations -$(relocation_packer_output): $(relocation_packer_input) | $(ACP) - $(pack-elf-relocations) -else -$(relocation_packer_output): $(relocation_packer_input) | $(ACP) - @echo "target Unpacked: $(PRIVATE_MODULE) ($@)" - $(copy-file-to-target) -endif $(cleantarget): PRIVATE_CLEAN_FILES += \ $(linked_module) \ - $(symbolic_output) \ - $(strip_output) + $(symbolic_output)