summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Pathak <rpathak@ventanamicro.com>2022-12-25 06:22:11 +0300
committerAnup Patel <anup@brainfault.org>2023-01-06 15:21:15 +0300
commit6509127ad620748c90c02b4bd32fa91df165ee82 (patch)
treedbf08516c049921927525d61cc84628c17c47b75
parent440fa818fbffd0771d75890c4fcda062ceab7ebd (diff)
downloadopensbi-6509127ad620748c90c02b4bd32fa91df165ee82.tar.xz
Makefile: Remove -N ldflag to prevent linker RWX warning
-N option coalesce all sections into single LOAD segment which causes data and other sections to have executable permission causing warning with new binutils ld 2.39. New ld emits warning when any segment have all three permissions RWX. ld.bfd: warning: test.elf has a LOAD segment with RWX permissions ld.bfd: warning: fw_dynamic.elf has a LOAD segment with RWX permissions ld.bfd: warning: fw_jump.elf has a LOAD segment with RWX permissions ld.bfd: warning: fw_payload.elf has a LOAD segment with RWX permissions This option was added in below commit - commit: eeab92f2423e ("Makefile: Convert to a more standard format") Removing -N option allows to have text and rodata into one LOAD segment and other sections into separate LOAD segment which prevents RWX permissions on single LOAD segment. Here X == E Current LOAD 0x0000000000000120 0x0000000080000000 0x0000000080000000 0x000000000001d4d0 0x0000000000032ed8 RWE 0x10 -N removed LOAD 0x0000000000001000 0x0000000080000000 0x0000000080000000 0x00000000000198cc 0x00000000000198cc R E 0x1000 LOAD 0x000000000001b000 0x000000008001a000 0x000000008001a000 0x00000000000034d0 0x0000000000018ed8 RW 0x1000 Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org> Tested-by: Samuel Holland <samuel@sholland.org>
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 92203c5..b742d6d 100644
--- a/Makefile
+++ b/Makefile
@@ -369,7 +369,7 @@ ASFLAGS += $(firmware-asflags-y)
ARFLAGS = rcs
ELFFLAGS += $(USE_LD_FLAG)
-ELFFLAGS += -Wl,--build-id=none -Wl,-N
+ELFFLAGS += -Wl,--build-id=none
ELFFLAGS += $(platform-ldflags-y)
ELFFLAGS += $(firmware-ldflags-y)