-
Notifications
You must be signed in to change notification settings - Fork 571
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
AArch64 fails to encode OP_ldr with pc-relative operand #5316
Comments
The disassembly assert is an encoding failure not due to ignoring the |
The issue of whether DR should mangle tool instructions, including the current state of doing so for all but ARM, is under #1834. So I think that means this issue should change to cover just the lack of pc-relative encoding for |
Enables building drbbdup and its tests on AArchXX. Adds case comparison, conditional branch, and TLS access code for both AArch64 and ARM. Uses optimizations for comparing small case values; a second scratch register is needed for larger values. Ports the tests by using OPND_CREATE_ABSMEM (xref #5295). To make these pc-relative case encoding loads work on AArchXX in the presence of AArch64 encoder bugs (#5316) and to avoid a more-complex interface, drbbdup auto-inserts loading the target address into its scratch register to avoid reachability problems (xref #1834 on having DR do this during mangling). Avoids storing block translations if there is no dynamic handling, improving robustness and reducing memory usage. Adds the tests to the passes-under-QEMU list for cross-compilation. Additionally, I tested manually on native ARM and AArch64 machines. Issue: #4134, #5295, #1834, #3995, #5316
Makes ARM behave like x86 and AArch64 by having DR mangle pc-relative operands in tool instructions on all architectures. Full support in DR's translation code is still needed. Similarly mangling stolen register and segment references is also still undone; it may require a new bit identifying "app operands". Issue: #1834, #5316
Makes ARM behave like x86 and AArch64 by having DR mangle pc-relative operands in tool instructions on all architectures. Full support in DR's translation code is still needed. Similarly mangling stolen register and segment references is also still undone; it may require a new bit identifying "app operands". Issue: #1834, #5316
For porting drbbdup to AArchXX for #4134 I changed the drbbdup tests to use rel-addr operands instead of abs-addr operands (via
OPND_CREATE_ABSMEM
) (xref #5295) and it all worked on AArch64: the tests pass. But they fail on ARM trying to encode the load of the rel-addr since it does not reach:When I went to see how a64 worked: when logging is enabled it hits an assert:
Yet without logging it works!
In the debugger we have:
The instrumentation had just a
ldr
with a rel-addr opnd: so who inserted themov;movk;movk
?Disabling the disassembly assert (looks like it only really needs it for the length: so maybe we should remove the encode there for a64) logging now works
It looks like the a64 mangling does the immediate-into-reg expansion.
But this is tool code: why is it being mangled?
Here we go:
So the
IF_ARM
doesn't apply to a64.#1834 is confusingly closed: I re-opened it since it does not seem completely resolved.
This issue covers the disas assert and specific aarchxx issues. The rest overlaps with #1834.
The text was updated successfully, but these errors were encountered: