objdiff
objdiff copied to clipboard
x86: Bug with functions that end with a jmp instruction in COFF obj files
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.
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.
A sample object would be super helpful, so I can make sure the relocations are getting processed correctly!
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.