proc: do not crash if executable doesn't have a PT_TLS section (#1483)
Fixes #1481
This commit is contained in:
parent
14aeea2bd9
commit
3ba4bcf488
@ -754,6 +754,10 @@ func (bi *BinaryInfo) setGStructOffsetElf(exe *elf.File, wg *sync.WaitGroup) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if tls == nil {
|
||||||
|
bi.gStructOffset = ^uint64(8) + 1 // -8
|
||||||
|
return
|
||||||
|
}
|
||||||
memsz := tls.Memsz
|
memsz := tls.Memsz
|
||||||
|
|
||||||
memsz = (memsz + uint64(bi.Arch.PtrSize()) - 1) & ^uint64(bi.Arch.PtrSize()-1) // align to pointer-sized-boundary
|
memsz = (memsz + uint64(bi.Arch.PtrSize()) - 1) & ^uint64(bi.Arch.PtrSize()-1) // align to pointer-sized-boundary
|
||||||
|
Loading…
Reference in New Issue
Block a user