Skip to content

Commit 62ba972

Browse files
committed
refactor: 简化链接脚本
Signed-off-by: YdrMaster <[email protected]>
1 parent 8a6cc2d commit 62ba972

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

ch1-lab/build.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ fn main() {
1010
const LINKER: &[u8] = b"
1111
OUTPUT_ARCH(riscv)
1212
SECTIONS {
13-
. = 0x80200000;
14-
.text : {
13+
.text 0x80200000 : {
1514
*(.text.entry)
1615
*(.text .text.*)
1716
}

ch1/build.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ fn main() {
1010
const LINKER: &[u8] = b"
1111
OUTPUT_ARCH(riscv)
1212
SECTIONS {
13-
. = 0x80200000;
14-
.text : {
13+
.text 0x80200000 : {
1514
*(.text.entry)
1615
*(.text .text.*)
1716
}

linker/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ pub use app::{AppIterator, AppMeta};
4040
pub const SCRIPT: &[u8] = b"\
4141
OUTPUT_ARCH(riscv)
4242
SECTIONS {
43-
. = 0x80200000;
44-
__start = .;
45-
.text : {
43+
.text 0x80200000 : {
44+
__start = .;
4645
*(.text.entry)
4746
*(.text .text.*)
4847
}

0 commit comments

Comments
 (0)