Merge "[MIPS] Makes a build system use PIE flag"
diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk
index 0a7e20f..1e649ec 100644
--- a/core/combo/TARGET_linux-mips.mk
+++ b/core/combo/TARGET_linux-mips.mk
@@ -84,7 +84,7 @@
TARGET_GLOBAL_CFLAGS += \
$(TARGET_mips_CFLAGS) \
-Ulinux -U__unix -U__unix__ -Umips \
- -fpic \
+ -fpic -fPIE\
-ffunction-sections \
-fdata-sections \
-funwind-tables \
@@ -244,7 +244,7 @@
endef
define transform-o-to-executable-inner
-$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic \
+$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -fPIE -pie \
-Wl,-dynamic-linker,/system/bin/linker \
-Wl,--gc-sections \
-Wl,-z,nocopyreloc \