* Mark Wielaard: > Hi Manoj, > > On Sat, 2021-02-06 at 07:03 +0000, Manoj Kumar via Elfutils-devel > wrote: >> Hi,Using dyninst, I am trying to access local variables and arguments >> of a function which is part of a go binary.To get local variables, >> dyninst uses libdw to find all the modules. It uses dwarf_nextcu >> function of libdw to find all the modules of binary.When I compile a >> go binary using "go build filename.go" then dwarf_nextcu finds all >> the modules (almost 118) and dyninst is able to access local >> variables and arguments of any function.But when I compile a go >> binary with linkshared option "go build -linkshared filename.go" >> then dwarf_nextcu finds only 5 modules. Due to that, dyninst is not >> able to access any variable of a function. >> Does go binary with linkshared option has different version of dwarf? >> Could you please suggest how to use libdw for go binary with >> linkshared option. > > Could you explain what the linkshared option is and what it does?
$ go tool link -help […] -linkshared link against installed Go shared libraries […] The Fedora version is broken, unfortunately: $ cat t.go package main func main() { } $ go build -linkshared t.go go build runtime/internal/sys: copying /home/fweimer/.cache/go-build/ef/ef8092ebd194e7ec34c864584fc2216541454e9626c98ffe9d5210d2784da429-d: open /usr/lib/golang/pkg/linux_amd64_dynlink/runtime/internal/sys.a: permission denied go build internal/cpu: copying /home/fweimer/.cache/go-build/ca/ca0a2dbbc130aa21613ca27f378b8c9fda02c4082687d92b40a0d6c660bc86d1-d: open /usr/lib/golang/pkg/linux_amd64_dynlink/internal/cpu.a: permission denied […] $ rpm -qf /usr/bin/go golang-bin-1.15.7-1.fc33.x86_64 Filed here: <https://bugzilla.redhat.com/show_bug.cgi?id=1688261> So I'm not sure how we can reproduce the elfutils issue. 8-/ Thanks, Florian -- Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243, Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill