Skip to content

Commit 69a9850

Browse files
alessandrodLucasSte
authored andcommitted
[SOL] tweak linker script
Ensure that all read only sections end up in one segment, and everything else in other segments. Discard .eh_frame, .hash and .gnu.hash since they are unused.
1 parent 20ab469 commit 69a9850

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

compiler/rustc_target/src/spec/sbf_base.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ PHDRS
88
{
99
text PT_LOAD ;
1010
rodata PT_LOAD ;
11+
data PT_LOAD ;
1112
dynamic PT_DYNAMIC ;
1213
}
1314
@@ -18,6 +19,14 @@ SECTIONS
1819
.rodata : { *(.rodata*) } :rodata
1920
.data.rel.ro : { *(.data.rel.ro*) } :rodata
2021
.dynamic : { *(.dynamic) } :dynamic
22+
.dynsym : { *(.dynsym) } :data
23+
.dynstr : { *(.dynstr) } :data
24+
.rel.dyn : { *(.rel.dyn) } :data
25+
/DISCARD/ : {
26+
*(.eh_frame*)
27+
*(.gnu.hash*)
28+
*(.hash*)
29+
}
2130
}
2231
";
2332
let mut lld_args = Vec::new();

0 commit comments

Comments
 (0)