aboutsummaryrefslogtreecommitdiff
path: root/src/debug/macho/file.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug/macho/file.go')
-rw-r--r--src/debug/macho/file.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/debug/macho/file.go b/src/debug/macho/file.go
index 73cfce3c76..cdc500e476 100644
--- a/src/debug/macho/file.go
+++ b/src/debug/macho/file.go
@@ -650,10 +650,14 @@ func (f *File) DWARF() (*dwarf.Data, error) {
return nil, err
}
- // Look for DWARF4 .debug_types sections.
+ // Look for DWARF4 .debug_types sections and DWARF5 sections.
for i, s := range f.Sections {
suffix := dwarfSuffix(s)
- if suffix != "types" {
+ if suffix == "" {
+ continue
+ }
+ if _, ok := dat[suffix]; ok {
+ // Already handled.
continue
}
@@ -662,7 +666,11 @@ func (f *File) DWARF() (*dwarf.Data, error) {
return nil, err
}
- err = d.AddTypes(fmt.Sprintf("types-%d", i), b)
+ if suffix == "types" {
+ err = d.AddTypes(fmt.Sprintf("types-%d", i), b)
+ } else {
+ err = d.AddSection(".debug_"+suffix, b)
+ }
if err != nil {
return nil, err
}