Created
October 11, 2016 01:19
-
-
Save toptensoftware/67e63c8f2eb3a3ddd7b3389a82e37def to your computer and use it in GitHub Desktop.
Applying Relocations
This file contains hidden or 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
| public override void Link(Machine machine) | |
| { | |
| for (int i = 0; i < _neFile.Segments.Count; i++) | |
| { | |
| // Get the segment | |
| var seg = segments[i]; | |
| // Get access to the byte array backing it | |
| var data = machine.GlobalHeap.GetBuffer(seg.globalHandle); | |
| // Apply all relocations | |
| for (int r=0; r<seg.relocations.Length; r++) | |
| { | |
| // What happens here depends on the kind of relocation | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment