Skip to content

Commit

Permalink
chore: update check order
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Jan 26, 2024
1 parent d0c7c9d commit 27b5286
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions elf.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,19 @@ func (e *elfFile) getPCLNTab() (*gosym.Table, error) {
// No section found. Check if the PIE section exist instead.
pclnSection = e.file.Section(".data.rel.ro.gopclntab")
}

var pclndat []byte
var err error

if pclnSection == nil {
pclndat, err = e.getSymbolData("runtime.pclntab", "runtime.epclntab")
if pclnSection != nil {
pclndat, err = pclnSection.Data()
if err != nil {
return nil, fmt.Errorf("could not get the pclntab data: %w", err)
return nil, fmt.Errorf("could not get the data for the pclntab: %w", err)
}
} else {
pclndat, err = pclnSection.Data()
pclndat, err = e.getSymbolData("runtime.pclntab", "runtime.epclntab")
if err != nil {
return nil, fmt.Errorf("could not get the data for the pclntab: %w", err)
return nil, fmt.Errorf("could not get the pclntab data: %w", err)
}
}

Expand Down

0 comments on commit 27b5286

Please sign in to comment.