From 65923c551ffeb33fb053180a5ddcaff1de7acee0 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Sat, 1 Jun 2024 19:39:59 +0200 Subject: [PATCH] Put .text into a separate ELF segment Avoids the creation of RWX segments which newer binutils warns about. --- ndless-sdk/system/ldscript | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ndless-sdk/system/ldscript b/ndless-sdk/system/ldscript index 5ff03eb..8c7a3bf 100644 --- a/ndless-sdk/system/ldscript +++ b/ndless-sdk/system/ldscript @@ -1,5 +1,10 @@ ENTRY(_start) +PHDRS { + text PT_LOAD; + data PT_LOAD; +} + SECTIONS { .text 0x0 : { _start = .; @@ -10,13 +15,13 @@ SECTIONS { KEEP(*(.fini_array)) KEEP(*(SORT_BY_INIT_PRIORITY(.fini_array.*))) *(.text.*) - } + } :text .got : { *(.got.plt*) *(.got) LONG(0xFFFFFFFF) - } + } :data .data : { *(.rodata*)