summaryrefslogtreecommitdiff
path: root/Makerules
diff options
context:
space:
mode:
authorFilippo Arcidiacono <filippo.arcidiacono@st.com>2010-08-02 17:23:35 +0200
committerCarmelo Amoroso <carmelo.amoroso@st.com>2010-09-17 16:13:17 +0200
commita33796043bdef5345bc00a528c942f91a87af8e9 (patch)
treed69b340439feac78601648c29efb34d9b889e5e8 /Makerules
parent02f56b3ae9f620528c3c1bb42662b4499d19f383 (diff)
ldso: Add runtime prelink support
Added runtime prelink support to be able to run a prelinked application; at process startup only the conflicts will be relocated. This speed up the startup time. Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules9
1 files changed, 9 insertions, 0 deletions
diff --git a/Makerules b/Makerules
index 2e9ca05bf..435ccfd9e 100644
--- a/Makerules
+++ b/Makerules
@@ -294,6 +294,15 @@ endef
cmd_hcompile.u = $(HOSTCC) $(filter-out $(PHONY),$^) $(DEPS-$(notdir $@)) -o $@ $(BUILD_LDFLAGS) $(BUILD_LDFLAGS-$(notdir $(^D))) $(BUILD_LDFLAGS-$(notdir $@)) $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@))
cmd_hcompile.o = $(HOSTCC) $(filter-out $(PHONY),$<) $(DEPS-$(notdir $@)) -c -o $@ $(BUILD_CFLAGS) $(BUILD_CFLAGS-$(notdir $(^D))) $(BUILD_CFLAGS-$(notdir $@))
+define create-lds
+ $(Q)$(RM) $@.lds
+ $(Q)$(CC) -nostdlib -nostartfiles -shared -Wl,-z,combreloc \
+ -Wl,-z,relro -Wl,--hash-style=gnu -Wl,-z,defs \
+ -Wl,--verbose 2>&1 | LC_ALL=C \
+ sed -e '/^=========/,/^=========/!d;/^=========/d' \
+ -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' > $@.lds
+endef
+
define link.so
$(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
@$(disp_ld)