* [PATCH] Fix linking with new ld, based on u-boot
@ 2017-05-10 17:49 Andrey Panov
2017-05-11 8:39 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Panov @ 2017-05-10 17:49 UTC (permalink / raw)
To: barebox
---
Makefile | 3 +++
images/Makefile | 3 +++
scripts/Kbuild.include | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index afa4bf802..c78f66f73 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
diff --git a/images/Makefile b/images/Makefile
index adf950aa9..8c5dac4bf 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -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 $@ \
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index c7faf67a2..310dcdc94 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -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)
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix linking with new ld, based on u-boot
2017-05-10 17:49 [PATCH] Fix linking with new ld, based on u-boot Andrey Panov
@ 2017-05-11 8:39 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2017-05-11 8:39 UTC (permalink / raw)
To: Andrey Panov; +Cc: barebox
Hi Andrey,
The patch looks fine, but lacks a signed-off-by. Could you resend?
Sascha
On Wed, May 10, 2017 at 08:49:49PM +0300, Andrey Panov wrote:
> ---
> Makefile | 3 +++
> images/Makefile | 3 +++
> scripts/Kbuild.include | 2 +-
> 3 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index afa4bf802..c78f66f73 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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)
> diff --git a/images/Makefile b/images/Makefile
> index adf950aa9..8c5dac4bf 100644
> --- a/images/Makefile
> +++ b/images/Makefile
> @@ -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 $@ \
> diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
> index c7faf67a2..310dcdc94 100644
> --- a/scripts/Kbuild.include
> +++ b/scripts/Kbuild.include
> @@ -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)
> --
> 2.11.0
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-11 8:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10 17:49 [PATCH] Fix linking with new ld, based on u-boot Andrey Panov
2017-05-11 8:39 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox