Add relocs back to the mix
This commit is contained in:
committed by
Timothy O'Barr
parent
bf185dbf0b
commit
8095830634
@@ -1,6 +1,7 @@
|
|||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
main (RWX) : ORIGIN = 0x100000, LENGTH = 0x0
|
main (RWX) : ORIGIN = 0x100000, LENGTH = 0x0
|
||||||
|
heap (RW) : ORIGIN = AFTER(main), LENGTH = 0x0
|
||||||
}
|
}
|
||||||
|
|
||||||
KEEP_SECTION
|
KEEP_SECTION
|
||||||
@@ -14,6 +15,12 @@ KEEP_SECTION
|
|||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
|
# define for crt0
|
||||||
|
_heap_size = 0x0149CC80;
|
||||||
|
_stack = 0x01F00000;
|
||||||
|
_stack_size = 0x00100000;
|
||||||
|
# define for lcf
|
||||||
|
_align_segment = 0x80;
|
||||||
|
|
||||||
.main :
|
.main :
|
||||||
{
|
{
|
||||||
@@ -24,4 +31,11 @@ SECTIONS
|
|||||||
|
|
||||||
. = ALIGN(0x80);
|
. = ALIGN(0x80);
|
||||||
} > main
|
} > main
|
||||||
|
|
||||||
|
.heap :
|
||||||
|
{
|
||||||
|
# to get the address for heap
|
||||||
|
end = .;
|
||||||
|
_end = .;
|
||||||
|
} > heap
|
||||||
}
|
}
|
||||||
|
|||||||
+2162
-2160
File diff suppressed because it is too large
Load Diff
+14
-1
@@ -211,7 +211,7 @@ def build_stuff(
|
|||||||
ninja = ninja_syntax.Writer(open(str(ROOT / config_dir / "build.ninja"), "w"), width=9999)
|
ninja = ninja_syntax.Writer(open(str(ROOT / config_dir / "build.ninja"), "w"), width=9999)
|
||||||
|
|
||||||
# Rules
|
# Rules
|
||||||
ld_args = "-map -sym on,elf -noinhibit-exec -main ENTRYPOINT -o $out $lcf $objects"
|
ld_args = "-map -sym on,elf -noinhibit-exec -main _start -o $out $lcf $objects"
|
||||||
|
|
||||||
ld = Path("..", (Path("tools") / "cc" / COMPILER / "mwldps2.exe"))
|
ld = Path("..", (Path("tools") / "cc" / COMPILER / "mwldps2.exe"))
|
||||||
cpp = Path("..", (Path("tools") / "cc" / COMPILER / "mwccps2.exe"))
|
cpp = Path("..", (Path("tools") / "cc" / COMPILER / "mwccps2.exe"))
|
||||||
@@ -796,6 +796,19 @@ def generate_lcf():
|
|||||||
f"\t\t__{section_type[1:]}_start = .;",
|
f"\t\t__{section_type[1:]}_start = .;",
|
||||||
f"\t\tALIGNALL(0x{alignment:X});",
|
f"\t\tALIGNALL(0x{alignment:X});",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if section_type == ".sdata":
|
||||||
|
block = [
|
||||||
|
"\t\t_gp\t= ALIGN(128) + 0x7FF0;",
|
||||||
|
"",
|
||||||
|
] + block
|
||||||
|
|
||||||
|
if section_type == ".sbss":
|
||||||
|
block = [
|
||||||
|
"\t\t_fbss\t= .;",
|
||||||
|
"",
|
||||||
|
] + block
|
||||||
|
|
||||||
for entry in objects:
|
for entry in objects:
|
||||||
alignment = entry.segment.ld_align_segment_start
|
alignment = entry.segment.ld_align_segment_start
|
||||||
if alignment is not None:
|
if alignment is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user