diff options
| author | Peter Waller <[email protected]> | 2014-06-01 16:07:24 +0100 |
|---|---|---|
| committer | Peter Waller <[email protected]> | 2014-06-01 16:07:24 +0100 |
| commit | 0780d68377a9c9418e74637c5d5b572b37f99fd4 (patch) | |
| tree | 5d069f25dab7f4c40589211079f0f545c6089619 | |
| parent | Merge pull request #6 from tmc/master (diff) | |
| parent | Only consider PT_LOAD at Offset == 0 (diff) | |
| download | goupx-0780d68377a9c9418e74637c5d5b572b37f99fd4.tar.xz goupx-0780d68377a9c9418e74637c5d5b572b37f99fd4.zip | |
Merge pull request #8 from pwaller/bugfix
Only consider PT_LOAD at Offset == 0
| -rw-r--r-- | hemfix/hemfix.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hemfix/hemfix.go b/hemfix/hemfix.go index 2425df1..8fa0be0 100644 --- a/hemfix/hemfix.go +++ b/hemfix/hemfix.go @@ -116,6 +116,10 @@ func fixelf(elf *ELF.File, fd io.ReadWriteSeeker) error { continue } + if p.Off != 0 { + continue + } + mask := -p.Align if ^mask&p.Vaddr != 0 && (^mask&(p.Vaddr-p.Off)) == 0 { log.Printf("Hemming PT_LOAD section") @@ -130,6 +134,7 @@ func fixelf(elf *ELF.File, fd io.ReadWriteSeeker) error { dst := off + int64(sz*i) writephdr(elf, dst, fd, p) + break } } return nil |