|
@@ -237,7 +237,11 @@ func GetBase(fh *elf.FileHeader, loadSegment *elf.ProgHeader, stextOffset *uint6
|
237
|
237
|
return start, nil
|
238
|
238
|
case elf.ET_DYN:
|
239
|
239
|
if offset != 0 {
|
240
|
|
- return 0, fmt.Errorf("Don't know how to handle mapping.Offset")
|
|
240
|
+ if loadSegment == nil || loadSegment.Vaddr == 0 {
|
|
241
|
+ return start - offset, nil
|
|
242
|
+ }
|
|
243
|
+ return 0, fmt.Errorf("Don't know how to handle mapping. Offset=%x, vaddr=%x",
|
|
244
|
+ offset, loadSegment.Vaddr)
|
241
|
245
|
}
|
242
|
246
|
if loadSegment == nil {
|
243
|
247
|
return start, nil
|