proc: fix autogenerated helper skip on linux/386 PIE builds (#2975)

The fix in #2959 was incomplete and the skip was still broken on
linux/386 for PIE builds due to calls to the get_pc_thunk helper.

Co-authored-by: a <a@kra>
This commit is contained in:
Alessandro Arzilli 2022-04-27 18:11:08 +02:00 committed by GitHub
parent bfb7181e8d
commit 9d269791d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -819,7 +819,14 @@ func skipAutogeneratedWrappersIn(p Process, startfn *Function, startpc uint64) (
for _, instr := range text {
switch {
case instr.IsCall():
if instr.DestLoc == nil || instr.DestLoc.Fn == nil {
if instr.DestLoc == nil {
return startfn, startpc
}
if p.BinInfo().Arch.inhibitStepInto(p.BinInfo(), instr.DestLoc.PC) {
// ignored
continue
}
if instr.DestLoc.Fn == nil {
return startfn, startpc
}
// calls to non private runtime functions