summaryrefslogtreecommitdiff
path: root/Makerules
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-04-14 23:58:41 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-04-14 23:58:41 +0200
commit1df50b08dfe4133d306156483a224f5a478f7dff (patch)
tree7756c09e562a7ef8cd084ef608f0d17a21d88a6a /Makerules
parentf820f4ce071ae0985d84e09ea74dc42d55081e86 (diff)
prelink: handle _begin in a gold-agnostic way
The nostartfiles is redundant but better be safe Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules13
1 files changed, 2 insertions, 11 deletions
diff --git a/Makerules b/Makerules
index 10dc5298f..dd19cea79 100644
--- a/Makerules
+++ b/Makerules
@@ -326,22 +326,13 @@ 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) $(LDFLAG-fuse-ld) $(CPU_LDFLAGS-y) \
- -nostdlib -nostartfiles -shared -Wl,-z,combreloc \
- -Wl,-z,relro $(CFLAG_-Wl--hash-style=gnu) -Wl,-z,defs \
- -x c /dev/null -Wl,--verbose 2>&1 | LC_ALL=C \
- $(SED) -e '/^=========/,/^=========/!d;/^=========/d' \
- -e 's/^\([ ]*\)\. = .* + SIZEOF_HEADERS;/&\n\1$(SYMBOL_PREFIX)_begin = . - SIZEOF_HEADERS;/' > $@.lds
-endef
-
define link.so
$(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
@$(disp_ld)
$(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(LDFLAGS-y-$(@F)) \
-Wl,-soname=$(notdir $@).$(2) \
- $(CFLAG_-nostdlib) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \
+ $(CFLAG_-nostdlib) $(CFLAG_-nostartfiles) \
+ -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \
-Wl,--whole-archive $(firstword $^) -Wl,--no-whole-archive \
$(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@))
$(Q)$(LN) -sf $(1) $@.$(2)