@@ -96,13 +96,13 @@ func NewHasFramePointersCache(logger log.Logger, reg prometheus.Registerer) Fram
9696
9797func HasFramePointers (executable string ) (bool , error ) {
9898 // TODO(kakkoyun): Migrate objectfile and pool.
99- elf , err := elf .Open (executable )
99+ f , err := elf .Open (executable )
100100 if err != nil {
101101 return false , fmt .Errorf ("failed to open ELF file for path %s: %w" , executable , err )
102102 }
103- defer elf .Close ()
103+ defer f .Close ()
104104
105- compiler := ainur .Compiler (elf )
105+ compiler := ainur .Compiler (f )
106106 // Go 1.7 [0] enabled FP for x86_64. arm64 got them enabled in 1.12 [1].
107107 //
108108 // Note: we don't take into account applications that use cgo yet.
@@ -131,8 +131,8 @@ func HasFramePointers(executable string) (bool, error) {
131131 // mixed mode unwinding (fp -> DWARF) won't work here.
132132 //
133133 // HACK: This is a somewhat a brittle check.
134- elfSymbols , err := elf .Symbols ()
135- if err != nil {
134+ elfSymbols , err := f .Symbols ()
135+ if err != nil && ! errors . Is ( err , elf . ErrNoSymbols ) {
136136 return false , fmt .Errorf ("failed to read symbols: %w" , err )
137137 }
138138 for _ , symbol := range elfSymbols {
0 commit comments