collect2: error: ld returned 1 exit status
Prajwal-PS7 opened this issue · 3 comments
Prajwal-PS7 commented
While installing tool by go command is returns an error!
└─$ go install github.com/lc/gau/v2/cmd/gau@latest
# github.com/lc/gau/v2/cmd/gau
/usr/bin/ld: warning: relfect2_ppc64x.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: /home/dom/.cache/go-build/81/8128b94c55afc6d5e66639543137706ae609c2267f822e5ba0505566eae009a4-d(_go_.o): in function `github_0com_1modern_x2dgo_1reflect2.UnsafeSliceType.UnsafeMakeSlice':
/home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_slice.go:78:(.text+0x15dee): undefined reference to `reflect.unsafe_NewArray'
/usr/bin/ld: /home/dom/.cache/go-build/81/8128b94c55afc6d5e66639543137706ae609c2267f822e5ba0505566eae009a4-d(_go_.o): in function `github_0com_1modern_x2dgo_1reflect2.unsafeType.UnsafeNew':
/home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48:(.text+0x16014): undefined reference to `reflect.unsafe_New'
/usr/bin/ld: /home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48:(.text+0x16044): undefined reference to `reflect.unsafe_New'
/usr/bin/ld: /home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48:(.text+0x16089): undefined reference to `reflect.unsafe_New'
/usr/bin/ld: /home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48:(.text+0x160c9): undefined reference to `reflect.unsafe_New'
/usr/bin/ld: /home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48:(.text+0x16109): undefined reference to `reflect.unsafe_New'
/usr/bin/ld: /home/dom/.cache/go-build/81/8128b94c55afc6d5e66639543137706ae609c2267f822e5ba0505566eae009a4-d(_go_.o):/home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48: more undefined references to `reflect.unsafe_New' follow
collect2: error: ld returned 1 exit status
bigmo6286 commented
all methods of installation returns error
Prajwal-PS7 commented
Yes
Prajwal-PS7 commented
I've been able to fix this problem. This error was caused by a go-lang package that did not install correctly. I fixed the go-lang binary and installed it again, and this time it worked!
While installing tool by go command is returns an error!
└─$ go install github.com/lc/gau/v2/cmd/gau@latest # github.com/lc/gau/v2/cmd/gau /usr/bin/ld: warning: relfect2_ppc64x.o: missing .note.GNU-stack section implies executable stack /usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker /usr/bin/ld: /home/dom/.cache/go-build/81/8128b94c55afc6d5e66639543137706ae609c2267f822e5ba0505566eae009a4-d(_go_.o): in function `github_0com_1modern_x2dgo_1reflect2.UnsafeSliceType.UnsafeMakeSlice': /home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_slice.go:78:(.text+0x15dee): undefined reference to `reflect.unsafe_NewArray' /usr/bin/ld: /home/dom/.cache/go-build/81/8128b94c55afc6d5e66639543137706ae609c2267f822e5ba0505566eae009a4-d(_go_.o): in function `github_0com_1modern_x2dgo_1reflect2.unsafeType.UnsafeNew': /home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48:(.text+0x16014): undefined reference to `reflect.unsafe_New' /usr/bin/ld: /home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48:(.text+0x16044): undefined reference to `reflect.unsafe_New' /usr/bin/ld: /home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48:(.text+0x16089): undefined reference to `reflect.unsafe_New' /usr/bin/ld: /home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48:(.text+0x160c9): undefined reference to `reflect.unsafe_New' /usr/bin/ld: /home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48:(.text+0x16109): undefined reference to `reflect.unsafe_New' /usr/bin/ld: /home/dom/.cache/go-build/81/8128b94c55afc6d5e66639543137706ae609c2267f822e5ba0505566eae009a4-d(_go_.o):/home/dom/go/pkg/mod/github.com/modern-go/reflect2@v1.0.2/unsafe_type.go:48: more undefined references to `reflect.unsafe_New' follow collect2: error: ld returned 1 exit status