objdiff icon indicating copy to clipboard operation
objdiff copied to clipboard

x86: Bug with functions that end with a jmp instruction in COFF obj files

Open jonwil opened this issue 10 months ago • 3 comments

I have a COFF obj file built with Microsoft Visual Studio and if I feed that obj file into objdiff, it fails with "unsupported LabelAddress relocation flags 20". After some analysis it seems to be caused when a function ends with a JMP instruction straight to another function.

jonwil avatar Apr 23 '24 13:04 jonwil

It looks like adding code to https://github.com/encounter/objdiff/blob/3e5008524e8556414ece25e5a0f8250ac9db57dc/objdiff-core/src/arch/x86.rs#L264 to also handle the pe::IMAGE_REL_I386_REL32 type avoids the error, though not sure if it provides the correct behaviour.

OmniBlade avatar May 03 '24 10:05 OmniBlade

A sample object would be super helpful, so I can make sure the relocations are getting processed correctly!

encounter avatar May 16 '24 01:05 encounter

Here is an example obj that triggers the issue along with its source code (which when compiled with the latest Visual C++ compiler using the default options produces the attached obj file) rtest.zip I hope this will be enough to fix the issue.

jonwil avatar May 17 '24 09:05 jonwil