Skip to content

Commit ea1b589

Browse files
committed
sw: fix relocation truncated to fit error
1 parent f3a0cee commit ea1b589

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

sw/link.ld

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,25 @@ SECTIONS
1919
{
2020
/DISCARD/ : { *(.riscv.attributes) *(.comment) }
2121

22-
.text._start 0x10000000 : { *(.text._start) } >SRAM
23-
.text : { *(.text) *(.text.*) } >SRAM
24-
.misc : { *(.sdata) *(.*) } >SRAM
25-
26-
__global_pointer$ = ADDR(.misc) + SIZEOF(.misc) / 2;
27-
__stack_pointer$ = ORIGIN(SRAM) + LENGTH(SRAM);
22+
.text._start : {
23+
*(.text._start)
24+
} >SRAM
2825

29-
status = 0x03000008;
26+
.misc : ALIGN(4) {
27+
*(.sdata)
28+
*(.sbss)
29+
*(.*data*)
30+
*(.*bss*)
31+
*(COMMON)
32+
} >SRAM
33+
34+
.text : ALIGN(4) {
35+
*(.text)
36+
*(.text.*)
37+
} >SRAM
3038
}
39+
40+
/* Global absolute symbols */
41+
PROVIDE(__global_pointer$ = ADDR(.misc) + SIZEOF(.misc)/2);
42+
PROVIDE(__stack_pointer$ = ORIGIN(SRAM) + LENGTH(SRAM));
43+
PROVIDE(status = 0x03000008);

0 commit comments

Comments
 (0)