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
Labels are not (fully) relocated if bound before used #53
Labels
Comments
Zeex
changed the title
Labels are not relocated if bound before used
Labels are not (fully) relocated if bound before used
Sep 21, 2014
Thanks! Affects 32-bit code generation. |
kobalicek
added a commit
that referenced
this issue
Sep 21, 2014
…the RelocData list). Refactored slightly so RelocData always uses `rd` variable name and added a scope into the buggy locations.
Merged
Hi Zeex, I opened another pull related to this, fixing also the second place where the exactly same bug happens. |
Merged, Closing this one and the original pull. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was recently upgrading a project of mine to the latest asmjit (previously used the one from Google Code) and made it to the point where everything compiles successfully but there's a problem at runtime, specifically with dword_ptr and labels.
I made a test program to demonstrate it:
bug.cpp:
CMakeLists.txt:
The program was designed to work with both old and new asmjit. As you can see, it makes a simple function with X86Assembler and then calls it and returns the result.
If you compile it with the old version of asmjit it will jump back to
label
and return0x11223344
, as expected. However, with the new (current) version jumps to the start of code and therefore returns0xdeadbeef
.If it helps, I've done some debugging and found that the
offset
variable inX86Assembler::_relocCode()
is0
instead of the real offset. I guess that means something is missing inX86Assembler_emit()
.Update:
Found a fix, see PR #53.
The text was updated successfully, but these errors were encountered: