On Fri, Sep 15, 2017 at 04:09:24AM -0700, nehs...@gmail.com wrote:

> Hi, I just found `ltrace` would yield "Couldn't find .dynsym or .dynstr in 
> "/proc/*/exe" with executable binary generated by "go build *.go".
> 
> Is there any options in `go build` could solve this problem?
> 
> Thanks a lot.
> 
> PS:
> $go version
> go version go1.9 linux/amd64
> $ cat hi.go 
> package main
> 
> 
> import "fmt"
> 
> 
> func main() {
>  fmt.Println("hi!")
> }
> $ go build hi.go
> $ ltrace ./hi
> Couldn't find .dynsym or .dynstr in "/proc/`*`/exe"

>From the description of the ltrace's Debian package, I gather that

| ltrace is a debugging program which runs a specified command until it
| exits.  While the command is executing, ltrace intercepts and records
| the dynamic library calls which are called by
| the executed process and the signals received by that process.
| It can also intercept and print the system calls executed by the program.

The Go compiler (of the "gc" suite you seem to use) generates statically
compiled executable which link with no dynamic libraries (at least on
Linux/amd64, with the reasonably current Go versions).

Supposedly this explains why you don't see the those ".dyn*" sections in
the generated ELF file.

So what is your goal, exactly?  What do you want to achieve?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to