mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-02 18:27:18 +00:00
Fix mips identification via RArchConfig instead of RAsm
This commit is contained in:
parent
8939854b8c
commit
34b21efc1e
@ -28,12 +28,13 @@ R_API bool r_core_file_close_all_but(RCore *core) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool __isMips(RAsm *a) {
|
||||
return a && a->cur && a->cur->arch && strstr (a->cur->arch, "mips");
|
||||
static bool its_a_mips(RCore *core) {
|
||||
RArchConfig *cfg = core->rasm->config;
|
||||
return cfg && cfg->arch && !strcmp (cfg->arch, "mips");
|
||||
}
|
||||
|
||||
static void loadGP(RCore *core) {
|
||||
if (__isMips (core->rasm)) {
|
||||
if (its_a_mips (core)) {
|
||||
ut64 e0 = r_num_math (core->num, "entry0");
|
||||
ut64 gp = r_num_math (core->num, "loc._gp");
|
||||
if ((!gp || gp == UT64_MAX) && (e0 && e0 != UT64_MAX)) {
|
||||
|
@ -90,7 +90,7 @@ RUN
|
||||
NAME=assembler
|
||||
FILE=-
|
||||
CMDS=<<EOF
|
||||
e asm.arch=mips.gnu
|
||||
e asm.arch=mips
|
||||
e asm.bits=32
|
||||
e cfg.bigendian=0
|
||||
pa lui t9, 0x41
|
||||
@ -112,7 +112,7 @@ RUN
|
||||
NAME=with-spaces
|
||||
FILE=-
|
||||
CMDS=<<EOF
|
||||
e asm.arch=mips.gnu
|
||||
e asm.arch=mips
|
||||
e asm.bits=32
|
||||
e cfg.bigendian=0
|
||||
pa addiu v0, v1, 33
|
||||
|
Loading…
Reference in New Issue
Block a user