-
Notifications
You must be signed in to change notification settings - Fork 55
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
ImpossibleRelocation error on seemingly valid AArch64 code #79
Comments
(I'm assuming the relevant instruction was I'm not sure what's happening here unfortunately. The relevant check that supposedly is creating the error would be here: https://github.com/CensoredUsername/dynasm-rs/blob/master/runtime/src/aarch64.rs#L70 . That'd probably be a good point to start debugging. Unfortunately with your example I really cannot really reproduce it easily. Do you may Are you sure this is the location causing the error? I tried making a simple reproduction case:
but that assembled just fine. |
Thanks, turns out it was user error, I'd managed to use That's all resolved, but if I can point out one other issue - it seems |
A yep, that'd do it. Due to a lack of nice to use associated types on structs in rust the interface between assemblers is somewhat weakly typed unfortunately.
Looking at the code both seem to actually expect an u64 if encoded at runtime, does that match your observations? That's indeed a bit useless for mov w0, . https://github.com/CensoredUsername/dynasm-rs/blob/master/plugin/src/arch/aarch64/compiler.rs#L609 is the offending line, but fixing that right now is both low priority and a breaking change. It's probably an artifact from the fact that compile-time encoding of constants always uses u64's internally |
All resolved thanks |
Hey, this is my first time using this library, so I apologise if I've made a stupid mistake, but this is really stumping me:
(the other part of the generation has
; .align 4; => end
. both are dynamic labels)But when I attempt to run this, I get an
ImpossibleRelocation
error, and I'm not sure why. As far as I know, provided it is within range (which it definitely is, this code isn't more than a few hundred bytes apart) and aligned to 4 bytes, these labels should be valid?The text was updated successfully, but these errors were encountered: