summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@jrtc27.com>2021-07-11 05:28:21 +0300
committerAnup Patel <anup@brainfault.org>2021-07-11 17:31:56 +0300
commita3d328ae33a3e64d219b50269b4c013d363e9b82 (patch)
tree02fe6f4e51ffe56cf00cfcbc9c68088d74477e52
parent397afe5ba1e9abeb48b801c864a56bda415441ce (diff)
downloadopensbi-a3d328ae33a3e64d219b50269b4c013d363e9b82.tar.xz
firmware: Explicitly pass -pie to the linker, not just the driver
When using Clang with a bare-metal triple, -pie does not get passed to the linker as it's not normally a thing that makes sense, unlike GCC which will unconditionally forward it on and potentially result in a linker error. However, LLD does support it, and manually forwarding it on works as desired, so do so to fully support FW_PIC with Clang and LLD. Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
-rw-r--r--firmware/objects.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/objects.mk b/firmware/objects.mk
index ce91c2f..83f98ad 100644
--- a/firmware/objects.mk
+++ b/firmware/objects.mk
@@ -21,7 +21,7 @@ ifeq ($(FW_PIC),y)
firmware-genflags-y += -DFW_PIC
firmware-asflags-y += -fpic
firmware-cflags-y += -fPIE -pie
-firmware-ldflags-y += -Wl,--no-dynamic-linker
+firmware-ldflags-y += -Wl,--no-dynamic-linker -Wl,-pie
endif
ifdef FW_TEXT_START