forked from m4b/faerie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Reloc::Data, which supports an addend
Fixes m4b#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
- Loading branch information
Showing
4 changed files
with
90 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters