Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i386 differ fails when diffing against code with old C++ header contents in the context? #143

Open
ChrisNonyminus opened this issue Feb 16, 2024 · 2 comments

Comments

@ChrisNonyminus
Copy link
Contributor

See this scratch: https://decomp.me/scratch/RbmNx
(Note: the header in question is a preprocessed context of bstring.h from the Hewlett Packard C++ STL.)

Diff error: Error running asm-differ: failed to find address immediate for line 'add %al,(%eax)'

@simonlindholm
Copy link
Owner

I'm pretty sure this is the same issue as described here: https://discord.com/channels/897066363951128586/897075447534354462/1205257191481675836. To quote:

I took a look at the .o you sent me. It looks to me like objdump is buggy here. The file is a COFF, with (objdump -h, objdump -t):

  1 .text         00000100  00000000  00000000  000001cc  2**4
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
...
  8 .text         000000b0  00000000  00000000  000003fa  2**4
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
[  8](sec  2)(fl 0x00)(ty    0)(scl   6) (nx 0) 0x000000f2 $L42316
...
[ 39](sec  9)(fl 0x00)(ty    0)(scl   6) (nx 0) 0x000000a9 $L42321

(0 vs 1-indexing there it seems, but otherwise matches up). objdump -d then emits two "Disassembly of section .text" and includes $L42321 in both of them
I wonder if a COFF -> ELF conversion tool in front of objdump could help?
or if one of the .text sections could be renamed? hex editing code.o and replacing the first and third .text with .texa makes it dump correctly

Oddly enough though I cannot reproduce with .o produced by decomp.me's export button and my local objdump... I wonder why.

@ChrisNonyminus
Copy link
Contributor Author

Another issue involving this:
This function matches, but asm-differ gives the wrong output. Note the seemingly "added" lines. https://decomp.me/scratch/wwqHU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants