Revert "Make the linker relocatable."
This reverts commit 994e9a5ed1c4e9f23a8bed79caea684eaa270027.
Broke x86 build.
diff --git a/linker/Android.mk b/linker/Android.mk
index 717e9c4..60f291c 100644
--- a/linker/Android.mk
+++ b/linker/Android.mk
@@ -10,9 +10,27 @@
dlfcn.c \
debugger.c
-LOCAL_LDFLAGS := -shared
+ifeq ($(TARGET_ARCH),sh)
+# SH-4A series virtual address range from 0x00000000 to 0x7FFFFFFF.
+LINKER_TEXT_BASE := 0x70000100
+else
+# This is aligned to 4K page boundary so that both GNU ld and gold work. Gold
+# actually produces a correct binary with starting address 0xB0000100 but the
+# extra objcopy step to rename symbols causes the resulting binary to be misaligned
+# and unloadable. Increasing the alignment adds an extra 3840 bytes in padding
+# but switching to gold saves about 1M of space.
+LINKER_TEXT_BASE := 0xB0001000
+endif
-LOCAL_CFLAGS += -fno-stack-protector
+# The maximum size set aside for the linker, from
+# LINKER_TEXT_BASE rounded down to a megabyte.
+LINKER_AREA_SIZE := 0x01000000
+
+LOCAL_LDFLAGS := -Wl,-Ttext,$(LINKER_TEXT_BASE)
+
+LOCAL_CFLAGS += -DPRELINK
+LOCAL_CFLAGS += -DLINKER_TEXT_BASE=$(LINKER_TEXT_BASE)
+LOCAL_CFLAGS += -DLINKER_AREA_SIZE=$(LINKER_AREA_SIZE)
# Set LINKER_DEBUG to either 1 or 0
#