Open Martins3 opened 3 years ago
What I expceted:
ideas:
TLB MOD fault
and TLB LD fault
, what's difference[53094.937397] epc = 0000000120002fe0 in dune.out[120000000+8000]
[53094.937408] ra = 0000000120002fdc in dune.out[120000000+8000]
1550 sudo yum install gcc
1551 sudo yum install devtoolset-7-gcc
1552 source /opt/rh/devtoolset-7/enable
0x1200ba368 : GOT
0x12000eec0 : puts
0xfffbf39b40 : ???
0x1200208b0 : strlen
[ ] we crash around the syscall
close:
0x0000000120023c20 <+64>: bnez a1,0x120023ca8 <getcwd+200>
0x0000000120023c24 <+68>: move s5,a0
-> 0x0000000120023c28 <+72>: bnez a0,0x120024110 <getcwd+1328>
lrwxrwxrwx 1 root root 20 1月 19 22:54 asm -> ../../../include/asm
lrwxrwxrwx 1 root root 28 1月 19 22:54 asm-generic -> ../../../include/asm-generic
lrwxrwxrwx 1 root root 22 1月 19 22:52 linux -> ../../../include/linux
Then, how to install musl in Loongson
Wow : musl works
Arguments are passed as required by the “o32” ABI. Most of the time, that means that up to four arguments are passed in the registers a0– a3; but there are corner cases where something else happens, and it’s all explained in section 11.2.1.
how to cross compile the musl
long __syscall_ret(unsigned long r)
{
if (r > -4096UL) {
errno = -r;
return -1;
}
return r;
}
0000000120003ef0 <__errno_location>:
120003ef0: 7c02e83b rdhwr v0,$29
120003ef4: 03e00008 jr ra
120003ef8: 64428f5c daddiu v0,v0,-28836
120003efc: 00000000 nop
Compliance Level: Required (Release 2). The HWREna register contains a bit mask that determines which hardware registers are accessible via the RDHWR instruction when that instruction is executed in a mode in which coprocessor 0 is not enabled
savereg.c
, we should usem
instead ofr
, so we will not pollute the regsiter