Skip to content

Commit

Permalink
Put .text into a separate ELF segment
Browse files Browse the repository at this point in the history
Avoids the creation of RWX segments which newer binutils warns about.
  • Loading branch information
Vogtinator committed Jun 1, 2024
1 parent 64e351b commit 7042bb8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ndless-sdk/system/ldscript
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
ENTRY(_start)

PHDRS {
text PT_LOAD;
data PT_LOAD;
}

SECTIONS {
.text 0x0 : {
_start = .;
Expand All @@ -10,13 +15,13 @@ SECTIONS {
KEEP(*(.fini_array))
KEEP(*(SORT_BY_INIT_PRIORITY(REVERSE(.fini_array.*))))
*(.text.*)
}
} :text

.got : {
*(.got.plt*)
*(.got)
LONG(0xFFFFFFFF)
}
} :data

.data : {
*(.rodata*)
Expand Down

0 comments on commit 7042bb8

Please sign in to comment.