diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-07-18 20:40:06 +1000 |
---|---|---|
committer | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2019-12-04 10:45:14 +0530 |
commit | 900ac95cfd173efca5a776590389c18abaa51666 (patch) | |
tree | 5c429e994c51377c9045fbc0f90c2640a995adf9 | |
parent | 5f0d8b1df4fcac19bcb2c0d1e6089b870dc2b15c (diff) | |
download | skiboot-900ac95cfd173efca5a776590389c18abaa51666.zip skiboot-900ac95cfd173efca5a776590389c18abaa51666.tar.gz skiboot-900ac95cfd173efca5a776590389c18abaa51666.tar.bz2 |
build: LDFLAGS pass -pie flag explicitly to ld
[ Upstream commit 705d2f190cfd6f2cf6e4d91efc1ca71edfbe18da ]
When building with some toolchains, the gcc -pie option does not
enable the linker pie without explicitly passing it to ld,
resulting in a non-PIE binary that silently fails (due to
relocation failure). This was observed with the powerpc64le
cross compiler for Debian.
Pass -Wl,-pie explicitly, which allows the powerpc64le toolchain
to create a position independnet binary that boots.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-rw-r--r-- | Makefile.main | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile.main b/Makefile.main index f6d9a43..772b1d1 100644 --- a/Makefile.main +++ b/Makefile.main @@ -100,6 +100,7 @@ CFLAGS += $(call try-cflag,$(CC),-Wjump-misses-init) \ CFLAGS += $(CWARNS) $(OPTS) $(DBG) LDFLAGS := -m64 -static -nostdlib -pie +LDFLAGS += -Wl,-pie LDFLAGS += -Wl,-Ttext-segment,$(LD_TEXT) -Wl,-N -Wl,--build-id=none LDFLAGS += -Wl,--no-multi-toc LDFLAGS += -mbig-endian -Wl,--oformat,elf64-powerpc |