asm-differ icon indicating copy to clipboard operation
asm-differ copied to clipboard

asm-differ should ignore relocations that do not apply to the function

Open mkst opened this issue 1 year ago • 0 comments

This scratch was created via objdiff (uploading a target.o file) and is disassmbled with the --disassemble=XXX flag. Exported zip is here: eMessageNextGyouMaxGet.zip

There are relocations in the objdump output that are unrelated to the function. asm-differ is trying to parse them when checking for previous relocations and so this results in a bad time (asm-differ tries to call int(%gp_rel(D_004DA918-0x20) which naturally throws an exception.

$ mips-linux-gnu-objdump --disassemble=eMessageNextGyouMaxGet --line-numbers --reloc target.o

target.o:     file format elf32-tradlittlemips


Disassembly of section .text:

00000138 <eMessageNextGyouMaxGet>:
eMessageNextGyou():
     138:	27bdffe0 	addiu	sp,sp,-32
			4: R_MIPS_GPREL16	D_004DA918
			a0: R_MIPS_26	xglFontGetSPcodeSize
			f0: R_MIPS_26	.text
     13c:	0080102d 	move	v0,a0
     140:	ffb00000 	sd	s0,0(sp)
     144:	0000802d 	move	s0,zero
     148:	ffb10008 	sd	s1,8(sp)
     14c:	2411001f 	li	s1,31
     150:	ffbf0010 	sd	ra,16(sp)
     154:	00000000 	nop
     158:	0040202d 	move	a0,v0
     15c:	0c000014 	jal	50 <eMessageNextGyou>
			15c: R_MIPS_26	.text
     160:	26100001 	addiu	s0,s0,1
     164:	80430000 	lb	v1,0(v0)
     168:	24450001 	addiu	a1,v0,1
     16c:	10600003 	beqz	v1,17c <eMessageNextGyouMaxGet+0x44>
     170:	3864000a 	xori	a0,v1,0xa
     174:	1471fff8 	bne	v1,s1,158 <eMessageNextGyouMaxGet+0x20>
     178:	00a4100a 	movz	v0,a1,a0
     17c:	0200102d 	move	v0,s0
     180:	dfb00000 	ld	s0,0(sp)
     184:	dfb10008 	ld	s1,8(sp)
     188:	dfbf0010 	ld	ra,16(sp)
     18c:	03e00008 	jr	ra
     190:	27bd0020 	addiu	sp,sp,32
     194:	00000000 	nop

mkst avatar Aug 03 '24 12:08 mkst