package main import ( "fmt" "debug/elf" ) func main() { f, err := elf.Open("/bin/ls") if err != nil { panic(err) } rpath, err := f.DynString(elf.DT_RPATH); fmt.Printf("%s\n", rpath) }