You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixesm4b#71
This commit creates a new variant 'Data' of the 'Reloc' enum.
This can be used to define a relocation to a data section entry
with a custom addend.
With this change, it's now possible to create a relocation representing
an index into an array or some other structure, where the addebd
represents the offset from the base.
I've only implemented this for ELF. Unfortunately, I'm completely
unfamiliar with Mach-O, and don't have an OS X instance available to
test with.
Additionally, I've moved the magic '-4' into a constant, and added some
documentation explaining where it comes from (though I may have a few
details wrong).
I've also tweaked the binary created by src/bin/main.rs to demonstrate
using Reloc::Data
https://github.com/CraneStation/cranelift/blob/master/cranelift-faerie/src/backend.rs#L236-L239
They are needed for at least one test in the rustc test suite. cc https://github.com/bjorn3/rustc_codegen_cranelift/issues/381.
The text was updated successfully, but these errors were encountered: