9
0
Fork 0

Fix linking with new ld, based on u-boot

This commit is contained in:
Andrey Panov 2017-04-19 22:25:17 +03:00 committed by Holger Hans Peter Freyther
parent e918d9035f
commit 1d8bdd6f22
3 changed files with 7 additions and 1 deletions

View File

@ -306,6 +306,9 @@ AFLAGS := -D__ASSEMBLY__
LDFLAGS_barebox := -Map barebox.map
# Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
LDFLAGS_barebox += $(call ld-option, --no-dynamic-linker)
# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)

View File

@ -53,6 +53,9 @@ extra-y += $(pbl-lds)
$(pbl-lds): $(obj)/../arch/$(ARCH)/lib/pbl.lds.S FORCE
$(call if_changed_dep,cpp_lds_S)
# Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
LDFLAGS += $(call ld-option, --no-dynamic-linker)
quiet_cmd_elf__ ?= LD $@
cmd_elf__ ?= $(LD) $(LDFLAGS) --gc-sections -pie \
-e $(2) -Map $@.map $(LDFLAGS_$(@F)) -o $@ \

View File

@ -148,7 +148,7 @@ cc-ldoption = $(call try-run,\
# ld-option
# Usage: LDFLAGS += $(call ld-option, -X)
ld-option = $(call try-run,\
$(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))
$(CC) -x c /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))
# ar-option
# Usage: KBUILD_ARFLAGS := $(call ar-option,D)