Chih-Hung Hsieh | 289e8d6 | 2018-05-24 15:13:19 -0700 | [diff] [blame] | 1 | ############################################################# |
| 2 | ## Set up my_pack_module_relocations |
| 3 | ## Input variables: |
| 4 | ## DISABLE_RELOCATION_PACKER, |
| 5 | ## LOCAL_PACK_MODULE_RELOCATIONS*, |
| 6 | ## *TARGET_PACK_MODULE_RELOCATIONS, |
| 7 | ## LOCAL_MODULE_CLASS, HOST_OS |
Colin Cross | 979f9f9 | 2018-06-25 12:33:35 -0700 | [diff] [blame] | 8 | ## LOCAL_IS_HOST_MODULE |
Chih-Hung Hsieh | 289e8d6 | 2018-05-24 15:13:19 -0700 | [diff] [blame] | 9 | ## Output variables: |
| 10 | ## my_pack_module_relocations, if false skip relocation_packer |
| 11 | ############################################################# |
| 12 | |
| 13 | my_pack_module_relocations := false |
| 14 | ifneq ($(DISABLE_RELOCATION_PACKER),true) |
| 15 | my_pack_module_relocations := $(firstword \ |
| 16 | $(LOCAL_PACK_MODULE_RELOCATIONS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) \ |
| 17 | $(LOCAL_PACK_MODULE_RELOCATIONS)) |
| 18 | endif |
| 19 | |
| 20 | ifeq ($(my_pack_module_relocations),) |
| 21 | my_pack_module_relocations := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_PACK_MODULE_RELOCATIONS) |
| 22 | endif |
| 23 | |
| 24 | # Do not pack relocations for executables. Because packing results in |
| 25 | # non-zero p_vaddr which causes kernel to load executables to lower |
| 26 | # address (starting at 0x8000) http://b/20665974 |
Colin Cross | 979f9f9 | 2018-06-25 12:33:35 -0700 | [diff] [blame] | 27 | ifeq ($(filter SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),) |
Chih-Hung Hsieh | 289e8d6 | 2018-05-24 15:13:19 -0700 | [diff] [blame] | 28 | my_pack_module_relocations := false |
| 29 | endif |
| 30 | |
Colin Cross | 979f9f9 | 2018-06-25 12:33:35 -0700 | [diff] [blame] | 31 | ifdef LOCAL_IS_HOST_MODULE |
| 32 | # Do not pack relocations on host modules |
Chih-Hung Hsieh | 289e8d6 | 2018-05-24 15:13:19 -0700 | [diff] [blame] | 33 | my_pack_module_relocations := false |
| 34 | endif |