Golang binary dwarf

Manoj Kumar manoj.gurukul@yahoo.com
Sun Feb 7 16:10:20 GMT 2021

I can upload the go binaries. Dyninst libraries have huge size so can't send those. Please let me know should I upload the go binaries?
Program OutputProgram without linkshared option is able to find the arguments of any function and displays number of arguments with their names but a program with linkshared option can't find any argument.
It's correct that there are less compiled units generated for a program with linkshared option. I think go binaries generated with linkshared option may have different dwarf.
How to get the dwarf generated code for any binary? Please help me on that. Sorry I'm not aware with this.
    On Sunday, 7 February, 2021, 08:48:25 pm IST, Mark Wielaard <mark@klomp.org> wrote:  

On Sun, 2021-02-07 at 14:54 +0000, Manoj Kumar wrote:
> Apologies for replying late.  The issue can be reproduced on Ubuntu.
> Please get the attached files & copy to some folder. If golang and
> Dyninst 10.2.1 version are installed on system then please follow the
> below steps:
> 1. export PATH_TO_DYNINST_LIB= <path to lib folder where dyninst
> libraries are installed, if not under /usr/local/lib>makeThis will
> create c++ binary testfile
> 2. compile golang program usinggo build wrapecho.goThis will create
> wrapechoRun wrapecho (./wrapecho) from terminal 1 and run testfile
> (./testfile wrapecho) from terminal 2.
> testfile will print the number of arguments and each argument name
> for each function of wrapecho (like Hellocat,hello)
> 3. compile golang program using linkshared option
> go build -linkshared wrapecho.goThis will create wrapecho
> if above command does not work then use below two commands:go install
> -buildmode=shared stdgo build -linkshared wrapecho.go
> Run wrapecho (./wrapecho) from terminal 1 and run testfile
> (./testfile wrapecho)testfile will print 0 number of arguments for
> each function.
> Please let me know if anything is required to reproduce the issue.

Not having an ubuntu, dyninst or go install I find the above
description somewhat confusing. Could you simply generate the binaries
yourself and upload them somewhere for inspection or show the DWARF
generated for those binaries?

What exactly is the output of your program on the different generated

I assume you mean that there are less Compile Units generated in the
DWARF than expected. If so I am not sure what elfutils can do about
that. It seems a bug in the experimental -sharedlink go linker option.



More information about the Elfutils-devel mailing list