美文网首页
golang buildmode

golang buildmode

作者: 已不再更新 | 来源:发表于2019-06-20 00:56 被阅读0次
    go install -buildmode=shared std
    go build -linkshared  hi.go 
    
    ll -h hi hii
      16K Jun 19 02:39 hi*
      2.0M Jun 19 02:43 hii*
    
    readelf -x .interp hi
    
    Hex dump of section '.interp':
      0x00400238 2f6c6962 36342f6c 642d6c69 6e75782d /lib64/ld-linux-
      0x00400248 7838362d 36342e73 6f2e3200          x86-64.so.2.
    
    readelf -x .interp hii
    Warning: Section '.interp' was not dumped because it does not exist!
    
    readelf -x .interp `which ls`
    
    Hex dump of section '.interp':
      0x00400238 2f6c6962 36342f6c 642d6c69 6e75782d /lib64/ld-linux-
      0x00400248 7838362d 36342e73 6f2e3200          x86-64.so.2.  
    

    参考:

    https://blog.lab99.org/post/golang-2017-10-01-video-go-build-mode.html#shared-go-de-dong-tai-lian-jie-ku

    相关文章

      网友评论

          本文标题:golang buildmode

          本文链接:https://www.haomeiwen.com/subject/djvcqctx.html