From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH] ARM: do not specify -static and -pie at the same time
Date: Sun, 1 Mar 2015 14:12:37 +0100 [thread overview]
Message-ID: <1425215557-6525-1-git-send-email-dev@lynxeye.de> (raw)
PIE is a form of dynamic linking and thus inherently incompatible
with -static. It worked ok as the current behavior of ld.bfd is
to not respect -static if -pie has been specified.
ld.gold and future versions of ld.bfd will fail to link if both
of those incompatible switches are specified at the same time.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
arch/arm/Makefile | 4 +++-
arch/arm/pbl/Makefile | 5 +++--
images/Makefile | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index f0133d4..b3abcae 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -105,10 +105,12 @@ CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
# Add cleanup flags
CPPFLAGS += -fdata-sections -ffunction-sections
-LDFLAGS_barebox += -static --gc-sections
+LDFLAGS_barebox += --gc-sections
ifdef CONFIG_RELOCATABLE
LDFLAGS_barebox += -pie
+else
+LDFLAGS_barebox += -static
endif
ifdef CONFIG_IMAGE_COMPRESSION
diff --git a/arch/arm/pbl/Makefile b/arch/arm/pbl/Makefile
index 1b90b37..4c1788d 100644
--- a/arch/arm/pbl/Makefile
+++ b/arch/arm/pbl/Makefile
@@ -31,10 +31,11 @@ $(obj)/zbarebox.S: $(obj)/zbarebox FORCE
$(call if_changed,disasm)
PBL_CPPFLAGS += -fdata-sections -ffunction-sections
-LDFLAGS_zbarebox := -Map $(obj)/zbarebox.map
-LDFLAGS_zbarebox += -static --gc-sections
+LDFLAGS_zbarebox := -Map $(obj)/zbarebox.map --gc-sections
ifdef CONFIG_PBL_RELOCATABLE
LDFLAGS_zbarebox += -pie
+else
+LDFLAGS_zbarebox += -static
endif
zbarebox-common := $(barebox-pbl-common) $(obj)/$(piggy_o)
zbarebox-lds := $(obj)/zbarebox.lds
diff --git a/images/Makefile b/images/Makefile
index 7c3aaf7..f7e978c 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -54,7 +54,7 @@ $(pbl-lds): $(obj)/../arch/$(ARCH)/lib/pbl.lds.S FORCE
$(call if_changed_dep,cpp_lds_S)
quiet_cmd_elf__ ?= LD $@
- cmd_elf__ ?= $(LD) $(LDFLAGS) -static --gc-sections -pie \
+ cmd_elf__ ?= $(LD) $(LDFLAGS) --gc-sections -pie \
-e $(2) -Map $@.map $(LDFLAGS_$(@F)) -o $@ \
-T $(pbl-lds) \
--start-group $(barebox-pbl-common) --end-group
--
2.1.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2015-03-01 13:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-01 13:12 Lucas Stach [this message]
2015-03-02 6:11 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1425215557-6525-1-git-send-email-dev@lynxeye.de \
--to=dev@lynxeye.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox