Use absolute path to binary when retrieving linkmode
This fixes some issues where the linkmode cannot be retrieved because of
non-absolute paths.
@@ -161,7 +161,12 @@ func (i *Info) String() string {
}
func getLinkmode() string {
- output, err := utils.ExecCmd("ldd", os.Args[0])
+ abspath, err := filepath.Abs(os.Args[0])
+ if err != nil {
+ return fmt.Sprintf("unknown: %v", err)
+ }
+
+ output, err := utils.ExecCmd("ldd", abspath)
if err != nil {
return fmt.Sprintf("unknown: %v", err)
}
