-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
415 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
enable_language(ASM) | ||
enable_language(C ASM) | ||
|
||
list(APPEND srcs | ||
list(APPEND srcs | ||
"start.S" | ||
"vectors.S" | ||
"syscalls.c" | ||
) | ||
|
||
add_library(common STATIC ${srcs}) | ||
target_include_directories(common PUBLIC include) | ||
target_include_directories(common PUBLIC) | ||
set_target_properties(common PROPERTIES C_STANDARD 11) | ||
target_compile_options(common PRIVATE -g -Og) | ||
target_link_libraries(common INTERFACE -nostartfiles) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
ENTRY(_start) | ||
|
||
SECTIONS | ||
{ | ||
.header : AT(0) | ||
{ | ||
_rom_start = .; | ||
LONG(0xaedb041d) | ||
LONG(0xaedb041d) | ||
} > rom | ||
|
||
.text.entry ORIGIN(rom) + 8 : | ||
{ | ||
KEEP(*(.text.entry)) | ||
} > rom | ||
|
||
.text : | ||
{ | ||
*(.text .stub .text.* .gnu.linkonce.t.*) | ||
*(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) | ||
*(.gnu.warning) | ||
} | ||
. = ALIGN(4); | ||
|
||
.rodata : | ||
{ | ||
*(.rodata .rodata1 .rodata.* .srodata .srodata.* .sdata2 .sdata2.* .gnu.linkonce.r.*) | ||
*(.rela.data .rela.data.* .rela.gnu.linkonce.r.*) | ||
} > rom | ||
|
||
.init_array : | ||
{ | ||
PROVIDE_HIDDEN (__init_array_start = .); | ||
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) | ||
KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) | ||
PROVIDE_HIDDEN (__init_array_end = .); | ||
} > rom | ||
|
||
.fini_array : | ||
{ | ||
PROVIDE_HIDDEN (__fini_array_start = .); | ||
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) | ||
KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) | ||
PROVIDE_HIDDEN (__fini_array_end = .); | ||
} > rom | ||
|
||
.ctors : | ||
{ | ||
KEEP (*crtbegin.o(.ctors)) | ||
KEEP (*crtbegin?.o(.ctors)) | ||
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) | ||
KEEP (*(SORT(.ctors.*))) | ||
KEEP (*(.ctors)) | ||
} > rom | ||
|
||
.dtors : | ||
{ | ||
KEEP (*crtbegin.o(.dtors)) | ||
KEEP (*crtbegin?.o(.dtors)) | ||
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) | ||
KEEP (*(SORT(.dtors.*))) | ||
KEEP (*(.dtors)) | ||
} > rom | ||
|
||
PROVIDE (__etext = .); | ||
PROVIDE (_etext = .); | ||
PROVIDE (etext = .); | ||
_rom_size = . - _rom_start; | ||
|
||
.data ORIGIN(ram) : AT(_rom_size) | ||
{ | ||
_data_start = .; | ||
__DATA_BEGIN__ = .; | ||
*(.data .data.* .gnu.linkonce.d.*) | ||
*(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) | ||
SORT(CONSTRUCTORS) | ||
} > ram | ||
.data1 : | ||
{ | ||
*(.data1) | ||
} | ||
.sdata : | ||
{ | ||
__SDATA_BEGIN__ = .; | ||
*(.sdata .sdata.* .gnu.linkonce.s.*) | ||
} | ||
. = ALIGN(4); | ||
_edata = .; PROVIDE (edata = .); | ||
_data_lma = ORIGIN(rom) + LOADADDR(.data); | ||
_data_size = _edata - _data_start; | ||
|
||
__bss_start = .; | ||
.sbss : | ||
{ | ||
*(.dynsbss) | ||
*(.sbss .sbss.* .gnu.linkonce.sb.*) | ||
*(.scommon) | ||
} | ||
.bss : | ||
{ | ||
*(.dynbss) | ||
*(.bss .bss.* .gnu.linkonce.b.*) | ||
*(COMMON) | ||
} | ||
. = ALIGN(4); | ||
__BSS_END__ = .; | ||
__global_pointer$ = MIN(__SDATA_BEGIN__ + 0x800, | ||
MAX(__DATA_BEGIN__ + 0x800, __BSS_END__ - 0x800)); | ||
_end = .; PROVIDE (end = .); | ||
|
||
/* Stack */ | ||
.stack : | ||
{ | ||
__stack_bottom = .; | ||
__stack_top = ORIGIN(ram) + LENGTH(ram); | ||
__stack_size_min = 0x4000; | ||
ASSERT(__stack_bottom + __stack_size_min < __stack_top, "Error: no space for stack"); | ||
} | ||
|
||
/* Stabs debugging sections. */ | ||
.stab 0 : { *(.stab) } | ||
.stabstr 0 : { *(.stabstr) } | ||
.stab.excl 0 : { *(.stab.excl) } | ||
.stab.exclstr 0 : { *(.stab.exclstr) } | ||
.stab.index 0 : { *(.stab.index) } | ||
.stab.indexstr 0 : { *(.stab.indexstr) } | ||
.comment 0 : { *(.comment) } | ||
.gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) } | ||
/* DWARF debug sections. | ||
Symbols in the DWARF debugging sections are relative to the beginning | ||
of the section so we begin them at 0. */ | ||
/* DWARF 1 */ | ||
.debug 0 : { *(.debug) } | ||
.line 0 : { *(.line) } | ||
/* GNU DWARF 1 extensions */ | ||
.debug_srcinfo 0 : { *(.debug_srcinfo) } | ||
.debug_sfnames 0 : { *(.debug_sfnames) } | ||
/* DWARF 1.1 and DWARF 2 */ | ||
.debug_aranges 0 : { *(.debug_aranges) } | ||
.debug_pubnames 0 : { *(.debug_pubnames) } | ||
/* DWARF 2 */ | ||
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } | ||
.debug_abbrev 0 : { *(.debug_abbrev) } | ||
.debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) } | ||
.debug_frame 0 : { *(.debug_frame) } | ||
.debug_str 0 : { *(.debug_str) } | ||
.debug_loc 0 : { *(.debug_loc) } | ||
.debug_macinfo 0 : { *(.debug_macinfo) } | ||
/* SGI/MIPS DWARF 2 extensions */ | ||
.debug_weaknames 0 : { *(.debug_weaknames) } | ||
.debug_funcnames 0 : { *(.debug_funcnames) } | ||
.debug_typenames 0 : { *(.debug_typenames) } | ||
.debug_varnames 0 : { *(.debug_varnames) } | ||
/* DWARF 3 */ | ||
.debug_pubtypes 0 : { *(.debug_pubtypes) } | ||
.debug_ranges 0 : { *(.debug_ranges) } | ||
/* DWARF Extension. */ | ||
.debug_macro 0 : { *(.debug_macro) } | ||
.debug_addr 0 : { *(.debug_addr) } | ||
.gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } | ||
/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) } | ||
} |
Oops, something went wrong.