Skip to content
Snippets Groups Projects
Commit 2f040671 authored by Per's avatar Per
Browse files

WIP SyncSim

parent 9d9f5ca9
No related branches found
No related tags found
No related merge requests found
Pipeline #165 canceled
......@@ -4,8 +4,15 @@
# "-C", "link-arg=-nostartfiles",
"-C", "relocation-model=static",
"-C", "inline-threshold=275",
"-C", "lto"
]
[target.mipseb-unknown-none]
rustflags = [
"-C", "link-arg=-Tlink.ld",
# "-C", "link-arg=-nostartfiles",
"-C", "relocation-model=static",
"-C", "inline-threshold=275",
]
[build]
target = "mipsel-unknown-none"
\ No newline at end of file
target = "mipseb-unknown-none"
\ No newline at end of file
......@@ -13,7 +13,8 @@ edition = "2018"
[profile.release]
#opt-level = 'z' # Optimize for size.
opt-level = 3 # Aggressive optimization
debug = true # keep debug symbols
#debug = true # keep debug symbols
debug = false # skip debug symbols
lto = true # Enable Link Time Optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
panic = 'abort' # Abort on panic
OUTPUT_FORMAT("elf32-tradbigmips")
OUTPUT_ARCH(mips)
START_ADDR = 0x00000000;
MEMORY_SIZE = 0x80000000;
ASSERT(DEFINED(_start), "Cannot find entry point: fn _start() -> !");
......@@ -20,6 +23,7 @@ SECTIONS
_gp = ALIGN(16);
. = 0x00001000;
.data :
{
__sdata = .;
......
a.out: file format elf32-tradbigmips
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 0000003c 00000000 00000000 00000060 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000040 00001000 00001000 00001060 2**4
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00001040 00001040 000010a0 2**0
ALLOC
3 .reginfo 00000018 00000000 00000000 000010a0 2**2
CONTENTS, READONLY, LINK_ONCE_SAME_SIZE
4 .pdr 00000000 00000000 00000000 000010b8 2**2
CONTENTS, READONLY
SYMBOL TABLE:
00000000 l d .text 00000000 .text
00001000 l d .data 00000000 .data
00001040 l d .bss 00000000 .bss
00000000 l d .reginfo 00000000 .reginfo
00000000 l d .pdr 00000000 .pdr
00000000 l d *ABS* 00000000 .shstrtab
00000000 l d *ABS* 00000000 .symtab
00000000 l d *ABS* 00000000 .strtab
00000000 l .text 00000000 main
00001000 l .data 00000000 intext
00001010 l .data 00000000 outtext
00000014 l .text 00000000 seek_end
00000028 l .text 00000000 seek_end1
00000038 l .text 00000000 copy
00000038 l .text 00000000 stop
00000000 g *ABS* 00000000 __start
Contents of section .text:
0000 3c090000 25291000 3c0a0000 254a1010 <...%)..<...%J..
0010 24080000 812b0000 11600003 25080001 $....+...`..%...
0020 25290001 1000fffb 01485021 a14b0000 %).......HP!.K..
0030 3c090000 25291000 1000ffff <...%)......
Contents of section .data:
1000 21646c72 6f57206f 6c6c6548 00000000 !dlroW olleH....
1010 78787878 78787878 78787878 78787878 xxxxxxxxxxxxxxxx
1020 78787878 78787878 78787878 78787878 xxxxxxxxxxxxxxxx
1030 00000000 00000000 00000000 00000000 ................
Contents of section .reginfo:
0000 10000f00 00000000 00000000 00000000 ................
0010 00000000 00000000 ........
Disassembly of section .text:
00000000 <_start>:
0: 27bdfff0 addiu sp,sp,-16
4: 3c010000 lui at,0x0
8: 24221000 addiu v0,at,4096
c: 3c010000 lui at,0x0
10: 24231000 addiu v1,at,4096
14: 0062082b sltu at,v1,v0
18: 10200006 beqz at,34 <START_ADDR+0x34>
1c: 00000000 nop
20: ac600000 sw zero,0(v1)
24: 24630004 addiu v1,v1,4
28: 0062082b sltu at,v1,v0
2c: 1420fffc bnez at,20 <START_ADDR+0x20>
30: 00000000 nop
34: 3c010000 lui at,0x0
38: 24221000 addiu v0,at,4096
3c: 3c010000 lui at,0x0
40: 24231000 addiu v1,at,4096
44: 0062082b sltu at,v1,v0
48: 10200009 beqz at,70 <START_ADDR+0x70>
4c: 00000000 nop
50: 3c010000 lui at,0x0
54: 24241000 addiu a0,at,4096
58: 8c810000 lw at,0(a0)
5c: ac610000 sw at,0(v1)
60: 24630004 addiu v1,v1,4
64: 0062082b sltu at,v1,v0
68: 1420fffb bnez at,58 <START_ADDR+0x58>
6c: 24840004 addiu a0,a0,4
70: 0c000037 jal dc <main>
74: 00000000 nop
78: 0000000d break
0000007c <_ZN7reverse3rev17h10307c82767293bfE>:
7c: 10a00015 beqz a1,d4 <_ZN7reverse3rev17h10307c82767293bfE+0x58>
80: 00000000 nop
84: 27bdfff0 addiu sp,sp,-16
88: afbf000c sw ra,12(sp)
8c: afb20008 sw s2,8(sp)
90: afb10004 sw s1,4(sp)
94: afb00000 sw s0,0(sp)
98: 24b2ffff addiu s2,a1,-1
9c: 00808825 move s1,a0
a0: 24840001 addiu a0,a0,1
a4: 00c08025 move s0,a2
a8: 02402825 move a1,s2
ac: 0c00001f jal 7c <_ZN7reverse3rev17h10307c82767293bfE>
b0: 02403825 move a3,s2
b4: 02120821 addu at,s0,s2
b8: 92220000 lbu v0,0(s1)
bc: 8fb00000 lw s0,0(sp)
c0: 8fb10004 lw s1,4(sp)
c4: 8fb20008 lw s2,8(sp)
c8: 8fbf000c lw ra,12(sp)
cc: a0220000 sb v0,0(at)
d0: 27bd0010 addiu sp,sp,16
d4: 03e00008 jr ra
d8: 00000000 nop
000000dc <main>:
dc: 27bdfff0 addiu sp,sp,-16
e0: afbf000c sw ra,12(sp)
e4: 3c010000 lui at,0x0
e8: 27a60000 addiu a2,sp,0
ec: 2405000b li a1,11
f0: 2407000b li a3,11
f4: aba00007 swl zero,7(sp)
f8: bba0000a swr zero,10(sp)
fc: afa00004 sw zero,4(sp)
100: afa00000 sw zero,0(sp)
104: 0c00001f jal 7c <_ZN7reverse3rev17h10307c82767293bfE>
108: 24240170 addiu a0,at,368
10c: 93a1000a lbu at,10(sp)
110: 93a10009 lbu at,9(sp)
114: 93a10008 lbu at,8(sp)
118: 93a10007 lbu at,7(sp)
11c: 93a10006 lbu at,6(sp)
120: 93a10005 lbu at,5(sp)
124: 93a10004 lbu at,4(sp)
128: 93a10003 lbu at,3(sp)
12c: 93a10002 lbu at,2(sp)
130: 93a10001 lbu at,1(sp)
134: 93a10000 lbu at,0(sp)
138: 0800004e j 138 <main+0x5c>
13c: 00000000 nop
{
"llvm-target": "mipseb-unknown-none",
"arch": "mips",
"cpu": "mips32r3",
"data-layout": "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64",
"executables": true,
"features": "+mips32r3,+soft-float",
"linker-flavor": "ld.lld",
"linker": "rust-lld",
"panic-strategy": "abort",
"max-atomic-width": 32,
"os": "none",
"target-c-int-width": "32",
"target-endian": "big",
"target-pointer-width": "32"
}
\ No newline at end of file
......@@ -96,7 +96,7 @@ pub extern "C" fn _start() -> ! {
unsafe {
zero_bss(&mut __sbss, &mut __ebss);
init_data(&mut __sdata, &mut __edata, &__sidata);
unsafe { main() }
main()
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment