diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2024-05-29 14:19:43 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2024-05-29 14:19:43 -0400 |
| commit | 843806d7c80bfec8fcea5fae81961fa35c91a804 (patch) | |
| tree | 32700c4a323d3fd9a81ba7f6d1663a5f7dfa28d0 /symbol.go | |
| parent | 05d10fb3a941aa384340d2999033aacb31e5f32f (diff) | |
ELF Implementation
Diffstat (limited to 'symbol.go')
| -rwxr-xr-x | symbol.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -18,6 +18,7 @@ type PosPair struct { var labels map[string]PosPair = make(map[string]PosPair) var SectionPos [4]uint +var SectionStart [4]uint const ( TEXT = 0 @@ -82,8 +83,15 @@ func LabelFind(path string, dTemp, rTemp *os.File) { if err != nil { panic(err) } + if Section == TEXT && s[0] == "la" { + offset += 4 + } *i += offset } + SectionStart[0] = 0 + SectionStart[1] = SectionPos[0] + SectionStart[2] = SectionPos[1] + SectionPos[1] + SectionStart[3] = SectionPos[2] + SectionPos[2] } func CalcOffset(s []string, Section uint8, dTemp, rTemp *os.File) (uint, error) { |
