Skip to content

Commit f18135b

Browse files
authored
Fix boot failure when compiling with Clang/LLD (#69)
- link.lds: Add .rodata section between .text and .data - start.S: Add .global _start, .type directive, rename entry to _start Signed-off-by: ann-yanan <yanan.hya@alibaba-inc.com>
1 parent 615296a commit f18135b

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

link.lds

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ SECTIONS
77
*(.text)
88
PROVIDE(_text_end = .);
99
}
10+
.rodata : {
11+
*(.rodata)
12+
*(.rodata.*)
13+
}
1014
. = ALIGN(8);
1115
.data : {
1216
PROVIDE(_data_start = .);

start.S

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#include "riscv_asm.h"
22
#include "riscv_encoding.h"
33

4+
.global _start
5+
.type _start, @function
6+
47
.global _load_start
58

69
#define BOOT_STATUS_RELOCATE_DONE 1
710

8-
entry:
11+
_start:
912
/*
1013
* Clear L1 cache & BTB & BHT ...
1114
*/
@@ -31,7 +34,7 @@ entry:
3134
*/
3235
lla t0, _load_start
3336
REG_L t2, 0(t0)
34-
lla t1, entry
37+
lla t1, _start
3538
REG_S t1, 0(t0)
3639

3740
/*

0 commit comments

Comments
 (0)