Add some stuff to help with using C in link.ld
This commit is contained in:
21
link.ld
21
link.ld
@@ -1,22 +1,31 @@
|
|||||||
ENTRY(_start)
|
ENTRY(_start)
|
||||||
|
|
||||||
SECTIONS {
|
MEMORY {
|
||||||
. = 0x80000000;
|
RAM (rwx) : ORIGIN = 0x80000000, LENGTH = 1M
|
||||||
|
}
|
||||||
|
|
||||||
|
SECTIONS {
|
||||||
.text : ALIGN(4) {
|
.text : ALIGN(4) {
|
||||||
|
*(.text._start)
|
||||||
*(.text*)
|
*(.text*)
|
||||||
}
|
} > RAM
|
||||||
|
|
||||||
.rodata : ALIGN(8) {
|
.rodata : ALIGN(8) {
|
||||||
*(.rodata*)
|
*(.rodata*)
|
||||||
}
|
} > RAM
|
||||||
|
|
||||||
.data : ALIGN(8) {
|
.data : ALIGN(8) {
|
||||||
|
_data = .;
|
||||||
*(.data*)
|
*(.data*)
|
||||||
}
|
_edata = .;
|
||||||
|
} > RAM
|
||||||
|
|
||||||
.bss : ALIGN(8) {
|
.bss : ALIGN(8) {
|
||||||
|
_bss = .;
|
||||||
*(.bss*)
|
*(.bss*)
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
}
|
_ebss = .;
|
||||||
|
} > RAM
|
||||||
|
|
||||||
|
_stack_top = ORIGIN(RAM) + LENGTH(RAM);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user