Skip to content

Commit 5724861

Browse files
committed
Fixup linker warning
LINK rtthread.elf show: ld: warning: rtthread.elf has a LOAD segment with RWX permission Add the attribute for sections to fix it. Signed-off-by: GuEe-GUI <[email protected]>
1 parent 61a5710 commit 5724861

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

libcpu/aarch64/link.lds.S

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ OUTPUT_ARCH(aarch64)
2020
#define ARCH_RAM_OFFSET 0
2121
#endif
2222

23+
PHDRS
24+
{
25+
text PT_LOAD FLAGS(5); /* PF_R(4) | PF_X(1) = 0x5 (RX) */
26+
data PT_LOAD FLAGS(6); /* PF_R(4) | PF_W(2) = 0x6 (RW) */
27+
stack PT_LOAD FLAGS(6); /* PF_R | PF_W */
28+
}
29+
2330
SECTIONS
2431
{
2532
_text_offset = ARCH_TEXT_OFFSET;
@@ -89,7 +96,7 @@ SECTIONS
8996
__usbh_class_info_end__ = .;
9097

9198
PROVIDE(__text_end = .);
92-
}
99+
} :text
93100

94101
.eh_frame_hdr :
95102
{
@@ -113,7 +120,7 @@ SECTIONS
113120
*(.sdata)
114121
*(.sdata.*)
115122
*(.rel.local)
116-
}
123+
} :data
117124

118125
. = ALIGN(8);
119126
.ctors :

0 commit comments

Comments
 (0)