aboutsummaryrefslogtreecommitdiff
path: root/src/debug/elf/file.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug/elf/file.go')
-rw-r--r--src/debug/elf/file.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/debug/elf/file.go b/src/debug/elf/file.go
index b25d8209e3..e265796ddc 100644
--- a/src/debug/elf/file.go
+++ b/src/debug/elf/file.go
@@ -494,7 +494,7 @@ func (f *File) getSymbols32(typ SectionType) ([]Symbol, []byte, error) {
data, err := symtabSection.Data()
if err != nil {
- return nil, nil, errors.New("cannot load symbol section")
+ return nil, nil, fmt.Errorf("cannot load symbol section: %w", err)
}
symtab := bytes.NewReader(data)
if symtab.Len()%Sym32Size != 0 {
@@ -503,7 +503,7 @@ func (f *File) getSymbols32(typ SectionType) ([]Symbol, []byte, error) {
strdata, err := f.stringTable(symtabSection.Link)
if err != nil {
- return nil, nil, errors.New("cannot load string table section")
+ return nil, nil, fmt.Errorf("cannot load string table section: %w", err)
}
// The first entry is all zeros.
@@ -537,7 +537,7 @@ func (f *File) getSymbols64(typ SectionType) ([]Symbol, []byte, error) {
data, err := symtabSection.Data()
if err != nil {
- return nil, nil, errors.New("cannot load symbol section")
+ return nil, nil, fmt.Errorf("cannot load symbol section: %w", err)
}
symtab := bytes.NewReader(data)
if symtab.Len()%Sym64Size != 0 {
@@ -546,7 +546,7 @@ func (f *File) getSymbols64(typ SectionType) ([]Symbol, []byte, error) {
strdata, err := f.stringTable(symtabSection.Link)
if err != nil {
- return nil, nil, errors.New("cannot load string table section")
+ return nil, nil, fmt.Errorf("cannot load string table section: %w", err)
}
// The first entry is all zeros.